From 820e3371b5de81d5e822d0ab7105ae1791f69abf Mon Sep 17 00:00:00 2001 From: Andreas Beckmann Date: Tue, 16 Feb 2021 10:00:57 +0000 Subject: [PATCH] Import pocl_1.6-5.debian.tar.xz [dgit import tarball pocl 1.6-5 pocl_1.6-5.debian.tar.xz] --- changelog | 810 ++++++++++++++++++ clean | 3 + control | 134 +++ copyright | 133 +++ libpocl-dev.install | 3 + libpocl2-common.install | 1 + libpocl2.install | 3 + libpocl2.lintian-overrides | 2 + libpocl2.symbols | 152 ++++ patches/0001-fix-build-on-hurd-i386.patch | 25 + ...gle-shared-libclang-cpp-when-buildin.patch | 37 + ...err_is_a_tty-to-pocl_stderr_is_a_tty.patch | 110 +++ ...me-fill_dev_-_t-to-pocl_fill_dev_-_t.patch | 101 +++ ...handle-dlsym-error-on-device-library.patch | 42 + ...bpocl-and-the-device-libraries-can-b.patch | 146 ++++ patches/0007-drop-redundant-include.patch | 27 + ...lobal-variable-pocl_num_device_types.patch | 24 + ...p-tests-and-add-missing-dependencies.patch | 122 +++ patches/0010-minor-cleanup.patch | 51 ++ ...l_export.h-for-new-macro-POCL_EXPORT.patch | 52 ++ .../0012-add-POCL_EXPORT-decorations.patch | 314 +++++++ ...3-add-VISIBILITY_HIDDEN-cmake-option.patch | 30 + ...bllvmopencl.so-which-is-no-longer-us.patch | 71 ++ ...to-additional-symbols-needed-by-the-.patch | 127 +++ ...1-add-testcase-for-Debian-bug-975931.patch | 214 +++++ ...e-setting-unroll-threshold-on-LLVM-9.patch | 32 + patches/distro.patch | 39 + patches/generic-cpu.patch | 71 ++ patches/series | 25 + ...-subdevice-tests-on-single-core-cpus.patch | 64 ++ patches/test_printf.patch | 40 + patches/test_structs_as_args.patch | 33 + patches/timeout.patch | 14 + patches/use-system-CL-headers.patch | 15 + patches/verbose.patch | 17 + pocl-doc.doc-base | 8 + pocl-doc.docs | 1 + pocl-opencl-icd.docs | 2 + pocl-opencl-icd.install | 1 + pocl-opencl-icd.lintian-overrides | 2 + rules | 127 +++ source/format | 1 + source/lintian-overrides | 2 + upstream/metadata | 4 + watch | 4 + 45 files changed, 3236 insertions(+) create mode 100644 changelog create mode 100644 clean create mode 100644 control create mode 100644 copyright create mode 100644 libpocl-dev.install create mode 100644 libpocl2-common.install create mode 100644 libpocl2.install create mode 100644 libpocl2.lintian-overrides create mode 100644 libpocl2.symbols create mode 100644 patches/0001-fix-build-on-hurd-i386.patch create mode 100644 patches/0002-link-against-single-shared-libclang-cpp-when-buildin.patch create mode 100644 patches/0003-rename-stderr_is_a_tty-to-pocl_stderr_is_a_tty.patch create mode 100644 patches/0004-rename-fill_dev_-_t-to-pocl_fill_dev_-_t.patch create mode 100644 patches/0005-handle-dlsym-error-on-device-library.patch create mode 100644 patches/0006-check-whether-libpocl-and-the-device-libraries-can-b.patch create mode 100644 patches/0007-drop-redundant-include.patch create mode 100644 patches/0008-drop-unused-global-variable-pocl_num_device_types.patch create mode 100644 patches/0009-regroup-workgroup-tests-and-add-missing-dependencies.patch create mode 100644 patches/0010-minor-cleanup.patch create mode 100644 patches/0011-add-include-pocl_export.h-for-new-macro-POCL_EXPORT.patch create mode 100644 patches/0012-add-POCL_EXPORT-decorations.patch create mode 100644 patches/0013-add-VISIBILITY_HIDDEN-cmake-option.patch create mode 100644 patches/1001-stop-building-libllvmopencl.so-which-is-no-longer-us.patch create mode 100644 patches/1014-add-POCL_EXPORT-to-additional-symbols-needed-by-the-.patch create mode 100644 patches/2001-add-testcase-for-Debian-bug-975931.patch create mode 100644 patches/2003-restore-setting-unroll-threshold-on-LLVM-9.patch create mode 100644 patches/distro.patch create mode 100644 patches/generic-cpu.patch create mode 100644 patches/series create mode 100644 patches/skip-subdevice-tests-on-single-core-cpus.patch create mode 100644 patches/test_printf.patch create mode 100644 patches/test_structs_as_args.patch create mode 100644 patches/timeout.patch create mode 100644 patches/use-system-CL-headers.patch create mode 100644 patches/verbose.patch create mode 100644 pocl-doc.doc-base create mode 100644 pocl-doc.docs create mode 100644 pocl-opencl-icd.docs create mode 100644 pocl-opencl-icd.install create mode 100644 pocl-opencl-icd.lintian-overrides create mode 100755 rules create mode 100644 source/format create mode 100644 source/lintian-overrides create mode 100644 upstream/metadata create mode 100644 watch diff --git a/changelog b/changelog new file mode 100644 index 0000000..5c48217 --- /dev/null +++ b/changelog @@ -0,0 +1,810 @@ +pocl (1.6-5) unstable; urgency=medium + + * Stop building libllvmopencl.so which is no longer used since 0.14. + * Build with -fvisibility=hidden. + + -- Andreas Beckmann Tue, 16 Feb 2021 11:00:57 +0100 + +pocl (1.6-4) unstable; urgency=medium + + * Restore setting unroll-threshold on LLVM 9 to avoid kernel/test_rotate + hanging on avx512 capable cpus. (Closes: #980626) + * Kill hanging tests after 30 minutes. + * Let dh_shlibdeps find libpocl-devices-basic.so. + * Do not use the embedded copy of the OpenCL headers. + * Build with -fvisibility-inlines-hidden. + * Drop hidden symbols. + * Bump Standards-Version to 4.5.1, no changes needed. + + -- Andreas Beckmann Wed, 03 Feb 2021 21:21:03 +0100 + +pocl (1.6-3) unstable; urgency=medium + + * Update symbols file. + * Upload to unstable. + + -- Andreas Beckmann Tue, 05 Jan 2021 02:08:00 +0100 + +pocl (1.6-2) experimental; urgency=medium + + * Build with -DHARDENING_ENABLE=ON. + * Update symbols file for amd64 and i386. + + -- Andreas Beckmann Mon, 28 Dec 2020 23:50:16 +0100 + +pocl (1.6-1) experimental; urgency=medium + + * New upstream release. + * Refresh/remove patches. + * Add testcase for bug #975931. + * Revert to llvm 9. (Reopens: #974797) + * Reintroduce "visibility hidden" to expose less internal symbols. + * Update symbols file for amd64 and i386. + + -- Andreas Beckmann Thu, 24 Dec 2020 04:19:57 +0100 + +pocl (1.5-8) experimental; urgency=medium + + * Cherry-pick upstream commits for llvm 11 support and some bugfixes. + * Switch to llvm 11. (Closes: #974797) + * Update symbols file for amd64 and i386. + * Upload to experimental. + + -- Andreas Beckmann Tue, 17 Nov 2020 17:08:26 +0100 + +pocl (1.5-7) unstable; urgency=medium + + * Switch to llvm 10. + * Update symbols file. + + -- Andreas Beckmann Mon, 16 Nov 2020 14:45:48 +0100 + +pocl (1.5-6) unstable; urgency=medium + + * Fix separate arch:all build in debhelper-compat 13 with + -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=OFF. + + -- Andreas Beckmann Wed, 29 Jul 2020 12:52:56 +0200 + +pocl (1.5-5) unstable; urgency=medium + + * Update symbols file. + * Switch to debhelper-compat (= 13). + * Fix typos found by Lintian. + + -- Andreas Beckmann Wed, 29 Jul 2020 02:18:39 +0200 + +pocl (1.5-4) unstable; urgency=medium + + * Rebuild with GCC 10. (Closes: #957694) + * Update symbols file. + + -- Andreas Beckmann Thu, 23 Jul 2020 14:20:52 +0200 + +pocl (1.5-3) unstable; urgency=medium + + * Update symbols file. + * Cherry-pick upstream commit 90fdec99 to avoid unwanted dependency on + symbols from libOpenCL.so.1. (Closes: #958700) + + -- Andreas Beckmann Mon, 27 Apr 2020 00:46:54 +0200 + +pocl (1.5-2) unstable; urgency=medium + + * The bullseye toolchain defaults to linking with --as-needed. + * Link against shared libclang-cpp when building with llvm >= 9. + * Update symbols file for amd64 and i386. + * Reduce local memory safety margin to prevent the pthread device from + running out of memory during initialization. This affects 32-bit builds + on platforms with large caches and large corecount. + * Upload to unstable. + + -- Andreas Beckmann Fri, 17 Apr 2020 16:40:56 +0200 + +pocl (1.5-1) experimental; urgency=medium + + * New upstream release. + * Refresh/remove patches. + * Update symbols file for amd64 and i386. + * Upload to experimental. + + -- Andreas Beckmann Sat, 04 Apr 2020 18:43:38 +0200 + +pocl (1.4-6) unstable; urgency=medium + + * Update symbols files. + * Upload to unstable. + + -- Andreas Beckmann Wed, 05 Feb 2020 20:55:06 +0100 + +pocl (1.4-5) experimental; urgency=medium + + * Update symbols files. + * Switch to llvm 9. + * Bump Standards-Version to 4.5.0, no changes needed. + * Upload to experimental. + + -- Andreas Beckmann Fri, 31 Jan 2020 17:11:45 +0100 + +pocl (1.4-4) unstable; urgency=medium + + * Postpone clinfo failures after dh_makeshlibs, too. + * Work around add_test_pocl() ignoring SKIP_RETURN_CODE. + + -- Andreas Beckmann Tue, 28 Jan 2020 12:02:47 +0100 + +pocl (1.4-3) unstable; urgency=medium + + * Update symbols files. + * Fix clash with altivec macros on ppc64el. + * Skip subdevice tests on (virtual) single core CPUs. + * Upload to unstable. + + -- Andreas Beckmann Sun, 19 Jan 2020 15:58:32 +0100 + +pocl (1.4-2) experimental; urgency=medium + + * Update symbols files. + * Switch to llvm 8. + + -- Andreas Beckmann Thu, 16 Jan 2020 03:03:18 +0100 + +pocl (1.4-1) experimental; urgency=medium + + * New upstream release. + * Refresh/remove patches. + * Link kernels with libm to avoid missing fma/fmaf/... symbols. + * Ignore regression/struct_kernel_arguments failure on i686. + * Switch back to llvm 7 for now. + * Update symbols files for amd64 and i386. + * Fix build on GNU/hurd, thanks to Samuel Thibault. (Closes: #947881) + * Update copyright holders and years. + * Upload to experimental. + + -- Andreas Beckmann Sat, 04 Jan 2020 11:08:11 +0100 + +pocl (1.3-10) unstable; urgency=medium + + * Use upstream version of upstreamed patches. + * Backport "Use libdl directly" and related fixes from 1.4. + (Closes: #946582, #946422) + * Drop B-D on libltdl-dev. + + -- Andreas Beckmann Thu, 26 Dec 2019 23:19:15 +0100 + +pocl (1.3-9) unstable; urgency=medium + + * Bump Standards-Version to 4.4.1, no changes needed. + * Upload to unstable. + + -- Andreas Beckmann Wed, 09 Oct 2019 23:15:27 +0200 + +pocl (1.3-8) experimental; urgency=medium + + * Switch to llvm 8. + * Update symbols files for amd64 and i386. + * Backport "Fixes to global memory size detection" from 1.4. + * Upload to experimental. + + -- Andreas Beckmann Wed, 25 Sep 2019 00:48:51 +0200 + +pocl (1.3-7) unstable; urgency=medium + + * Try a fix for allocation limit computation on kfreebsd-i386. + * Upload to unstable. + + -- Andreas Beckmann Tue, 24 Sep 2019 00:55:41 +0200 + +pocl (1.3-6) experimental; urgency=medium + + * Update symbols files. + * Ignore workgroup/loop_with_two_paths_to_the_latch_LOOPS failures. + + -- Andreas Beckmann Sat, 14 Sep 2019 19:49:14 +0200 + +pocl (1.3-5) experimental; urgency=medium + + * Switch to llvm 7, again. (Closes: #912793, #932707) + * Update symbols files for amd64 and i386. + * Upload to experimental. + + -- Andreas Beckmann Tue, 27 Aug 2019 18:35:12 +0200 + +pocl (1.3-4) unstable; urgency=medium + + * Enable --exclude-libs on kFreeBSD. + * Tune symbols files. + + -- Andreas Beckmann Fri, 06 Sep 2019 23:13:34 +0200 + +pocl (1.3-3) unstable; urgency=medium + + * Rebuild with gcc 9. + * Update symbols files for amd64 and i386. + + -- Andreas Beckmann Sat, 24 Aug 2019 07:37:21 +0200 + +pocl (1.3-2) unstable; urgency=medium + + * Update symbols files. + * Bump Standards-Version to 4.4.0, no changes needed. + * Upload to unstable. + + -- Andreas Beckmann Sun, 14 Jul 2019 15:35:36 +0200 + +pocl (1.3-1) experimental; urgency=medium + + * New upstream release. + * Refresh/remove patches. + * Switch back to llvm 6.0 for now. + * Update symbols files for amd64 and i386. + * Upload to experimental. + + -- Andreas Beckmann Sat, 13 Jul 2019 13:33:22 +0200 + +pocl (1.2-10) experimental; urgency=medium + + * Switch to llvm 7. (Closes: #912793) + * Update symbols files. + * Upload to experimental. + + -- Andreas Beckmann Mon, 11 Feb 2019 16:56:57 +0100 + +pocl (1.2-5) unstable; urgency=medium + + * Disable dh_dwz which fails on 32-bit platforms, see #918903. + + -- Andreas Beckmann Tue, 05 Feb 2019 00:39:59 +0100 + +pocl (1.2-4) unstable; urgency=medium + + * Cherry-pick upstream "Fix kernel debug data emission". (Closes: #919824) + * Switch to debhelper-compat (= 12). + * Upload to unstable. + + -- Andreas Beckmann Mon, 04 Feb 2019 16:08:38 +0100 + +pocl (1.2-3) experimental; urgency=medium + + * kernel/test_printf: Add more tests. + * Perform compile test to select -march or -mcpu for clang. + * Upload to experimental. + + -- Andreas Beckmann Mon, 21 Jan 2019 01:34:24 +0100 + +pocl (1.2-2) unstable; urgency=medium + + * Update symbols files. + * Upload to unstable. + + -- Andreas Beckmann Tue, 15 Jan 2019 16:55:49 +0100 + +pocl (1.2-1) experimental; urgency=medium + + * New upstream release. + * Remove patches that were applied upstream. + * Cherry-pick upstream commit fixing LINK_WITH_CLANG. + * Do not link with --rtlib=compiler-rt at all. + * Ignore kernel/test_printf failure on i686. + + -- Andreas Beckmann Fri, 11 Jan 2019 19:49:24 +0100 + +pocl (1.2~rc2-1) experimental; urgency=medium + + * New upstream release candidate. + * Refresh/remove patches. + * Update symbols files for amd64 and i386. + * Upload to experimental. + + -- Andreas Beckmann Fri, 07 Sep 2018 19:14:21 +0200 + +pocl (1.1-9) unstable; urgency=medium + + * Drop unused deprecated module 'sphinx.ext.pngmath'. (Closes: #918828) + * Update symbols files. + + -- Andreas Beckmann Thu, 10 Jan 2019 00:56:33 +0100 + +pocl (1.1-8) unstable; urgency=medium + + * Update symbols files. (Closes: #916024) + * Fix building in armel chroot on arm64 host. (Closes: #917244) + * Switch to debhelper-compat (= 11). + * Bump Standards-Version to 4.3.0, no changes needed. + * Update Lintian overrides. + + -- Andreas Beckmann Tue, 08 Jan 2019 13:04:26 +0100 + +pocl (1.1-7) unstable; urgency=medium + + * Update symbols files. + * Upload to unstable. + + -- Andreas Beckmann Fri, 07 Sep 2018 16:04:52 +0200 + +pocl (1.1-6) experimental; urgency=medium + + * pocl-opencl-icd: Mark as Multi-Arch: same. + * Fix building in armhf chroot on arm64 host. + * Bump Standards-Version to 4.2.1, no changes needed. + * Update symbols files. + * Upload to experimental. + + -- Andreas Beckmann Thu, 06 Sep 2018 14:11:03 +0200 + +pocl (1.1-5) unstable; urgency=medium + + * Upload to unstable. + + -- Andreas Beckmann Mon, 09 Apr 2018 14:42:39 +0200 + +pocl (1.1-4) experimental; urgency=medium + + * Run clinfo during testing. + * Do not link with --rtlib=compiler-rt on non-x86. (Closes: #892426) + * Prevent PIC/no-PIC option clash on mips64el. + * Set target cpu for armel to arm946e-s (arch=armv5te). + * Set target cpu for armhf to arm1156t2f-s (arch=armv6t2) with + -mfpu=vfp3-d16. Probably suboptimal (should rather be arch=armv7-a without + neon,vfp4), but passes all tests. (Closes: #888063) + * Bump Standards-Version to 4.1.4, no changes needed. + + -- Andreas Beckmann Fri, 06 Apr 2018 19:39:01 +0200 + +pocl (1.1-3) experimental; urgency=medium + + * Add support for building for the GENERIC cpu, i.e. llvm defaults. + * Build with -DLLC_HOST_CPU=GENERIC on most architectures. + * Build with -DKERNELLIB_HOST_CPU_VARIANTS=distro on amd64. + * Switch to llvm 6.0. (Closes: #892428) + + -- Andreas Beckmann Tue, 27 Mar 2018 13:12:40 +0200 + +pocl (1.1-2) experimental; urgency=medium + + * Switch to llvm 5.0. + * Update symbols files for amd64 and i386. + * Cherry-pick upstream commits for libhwloc 2.0 support. + * Cherry-pick upstream commit fixing test_clCreateSubDevices with 3 CUs. + * Cherry-pick upstream commit fixing reported values of native/preferred + vector width for unsupported types. + * pocl-doc: Mark as Multi-Arch: foreign. + * Upload to experimental. + + -- Andreas Beckmann Sun, 25 Mar 2018 17:35:44 +0200 + +pocl (1.1-1) unstable; urgency=medium + + * New upstream release. + * Remove patches, applied or fixed upstream. + * Remove -DFORCE_OCL_KERNEL_TARGET_CPU=ON, fixed upstream. + * Report the error code on test failure. + * Point watch file to git tags on github. + * Add debian/upstream/metadata. + * Upload to unstable. + + -- Andreas Beckmann Sat, 10 Mar 2018 00:37:43 +0100 + +pocl (1.1~rc2-1) experimental; urgency=medium + + * New upstream release candidate. (Closes: #888062) + * Remove patches that were applied upstream. + * Update symbols files. + * Do not attempt to run the testsuite during an arch-indep build. + * Set LLVM_ARCH for arm64, armel, armhf to generic. + * Set LLVM_ARCH for s390x to z10. (Closes: #888064) + * Drop internal helper library packages libpoclu-dev and libpoclu2. + * Add altivec.patch to get rid of the conflicting bool and vector macros + from altivec.h. (Closes: #764561) + * Update Lintian overrides. + * Upload to experimental. + + -- Andreas Beckmann Tue, 27 Feb 2018 17:31:09 +0100 + +pocl (1.0-2) unstable; urgency=medium + + * Merge changes from 0.14-7. + * Build with SLEEF instead of VECMATHLIB. + * HACK: Ignore test failure for kernel/test_fabs on i386. + * Add and use new CMake option -DFORCE_OCL_KERNEL_TARGET_CPU=ON. + * Upload to unstable. + + -- Andreas Beckmann Fri, 19 Jan 2018 01:11:11 +0100 + +pocl (1.0-1) experimental; urgency=medium + + * New upstream release. + * Refresh/remove patches. + * Build with -DPOCL_ICD_ABSOLUTE_PATH=OFF. + * Rename library packages for SOVERSION bump: 1 => 2. + * Update symbols files for amd64 and i386. + * Build with -DENABLE_VECMATHLIB=ON. + * Upload to experimental. + + -- Andreas Beckmann Wed, 17 Jan 2018 14:13:19 +0100 + +pocl (0.14-7) unstable; urgency=medium + + * Switch to llvm 4.0. (Closes: #873417) + * Update symbols files for amd64 and i386. + + -- Andreas Beckmann Wed, 17 Jan 2018 18:36:08 +0100 + +pocl (0.14-6) unstable; urgency=medium + + * Switch to debhelper compat level 11. + * Bump Standards-Version to 4.1.3, no changes needed. + * Switch Vcs-* to salsa.debian.org. + * Remove superfluous patches. + + -- Andreas Beckmann Wed, 17 Jan 2018 06:13:22 +0100 + +pocl (0.14-5) unstable; urgency=medium + + * Upload to unstable. + + -- Andreas Beckmann Mon, 18 Dec 2017 01:44:17 +0100 + +pocl (0.14-4) experimental; urgency=medium + + * Switch to llvm 3.9. + * Update symbols files for amd64 and i386. + + -- Andreas Beckmann Sat, 16 Dec 2017 05:24:25 +0100 + +pocl (0.14-3) experimental; urgency=medium + + * Cherry-pick upstream [c9d2cd15] "llvm/Flatten: switch back to + force-inlining only some funcs", fixing kernel/test_convert_type_* failing + on i386 with LLC_HOST_CPU=i686. + * Switch LLC_HOST_CPU from "pentium3" to the correct baseline "i686" on + i386. + * kernel/test_printf actually passes on i386 with LLC_HOST_CPU=i686. + * Only override POCL_CACHE_DIR for the testsuite, not HOME. + + -- Andreas Beckmann Fri, 15 Dec 2017 07:08:32 +0100 + +pocl (0.14-2) experimental; urgency=medium + + * Cherry-pick upstream [62b74d6f] "Fix malloc size in tests/runtime/ + test_clBuildProgram.c", fixing runtime/clBuildProgram failing frequently + on i386. + * Try to guess the minimal cpu for more architectures. + + -- Andreas Beckmann Thu, 14 Dec 2017 01:37:41 +0100 + +pocl (0.14-1) experimental; urgency=medium + + * New upstream release. + * The autotools based build system is gone. + * Refresh/remove patches. + * Use the CMAKE_INSTALL_SYSCONFDIR setting for /etc. + * Update symbols files. + * Update copyright holders and years. + * Remove pocl-standalone(1) manpage. The binary is no longer shipped. + * Ship the new poclcc binary in libpocl-dev. + * Do not downgrade to -std=c++11, fixing test_fabs failing on i386. + (Closes: #883613) + * Upload to experimental. + + -- Andreas Beckmann Tue, 12 Dec 2017 03:48:35 +0100 + +pocl (0.13-14) unstable; urgency=medium + + * Bump Standards-Version to 4.1.2, no changes needed. + * cmake-no-get_cpu_name.patch: Rename/redo as + cmake-no-llvm-sys-getHostCPUName.patch to not use + llvm::sys::getHostCPUName(). + * Clean up generated include/CL/cl.hpp* to fix building twice in a row. + * Upload to unstable. + + -- Andreas Beckmann Fri, 08 Dec 2017 18:55:52 +0100 + +pocl (0.13-13) experimental; urgency=medium + + * Fix cmake i386 detection, thanks to James Price. (Closes: #882875) + + -- Andreas Beckmann Tue, 28 Nov 2017 03:04:06 +0100 + +pocl (0.13-12) experimental; urgency=medium + + * Switch to cmake build system. + * llvmopencl.so.7 is now a private library. (Closes: #823528) + * cmake-no-fno-rtti.patch: Build without -fno-rtti (a workaround for + clang-3.7), like autotools, to avoid symbol changes. + * cmake-no-get_cpu_name.patch: Do not use get_cpu_name(), makes some tests + fail. + * cmake-forcibly-link-regtests-with-pthread.patch: Link regression tests + with -lpthread unconditionally, otherwise test_issue_231 fails. + * Upload to experimental. + + -- Andreas Beckmann Mon, 27 Nov 2017 16:01:58 +0100 + +pocl (0.13-11) unstable; urgency=medium + + * Add Built-Using control field for linking against static clang libraries. + * do-not-export-clang-symbols.patch: Link static clang libraries with + --exclude-libs to not export their symbols. + * Update symbols files. + + -- Andreas Beckmann Sun, 26 Nov 2017 19:22:48 +0100 + +pocl (0.13-10) unstable; urgency=medium + + * Update symbols files. + * Bump Standards-Version to 4.1.1, no changes needed. + * Use dpkg makefile snippets instead of parsing the changelog manually. + * Switch B-D-I: python-sphinx to python3-sphinx. + * Set Rules-Requires-Root: no. + * set-POCL_DEVICE_ADDRESS_BITS-before-use.patch: Fix use-before-init in + CMakeLists.txt causing i386 to be misdetected as x86_64. + * Do not export libOpenCL.so.1 symbols. + + -- Andreas Beckmann Sat, 25 Nov 2017 21:03:13 +0100 + +pocl (0.13-9) unstable; urgency=medium + + * Work around using clang-3.8 with libstdc++-7-dev. (Closes: #853620) + * Update symbols files. + * Switch to debhelper compat level 10. + * Bump Standards-Version to 4.0.1. + * Raise Priority to optional. + * Support nodoc build. + * Do not mark the -dev packages as Multi-Arch: foreign. + * Move kernel-.bc from libpocl1-common into libpocl1. + + -- Andreas Beckmann Mon, 07 Aug 2017 04:57:35 +0200 + +pocl (0.13-8) unstable; urgency=medium + + * Enable more hardening. + * Reduce superfluous dependencies by linking with --as-needed. + * Update symbols files. + * Update lintian overrides. + + -- Andreas Beckmann Mon, 10 Oct 2016 13:38:39 +0200 + +pocl (0.13-7) unstable; urgency=medium + + * Update symbols files. + + -- Andreas Beckmann Fri, 09 Sep 2016 19:51:19 +0200 + +pocl (0.13-6) unstable; urgency=medium + + * Update symbols files. (Closes: #835690, #836219) + + -- Andreas Beckmann Tue, 06 Sep 2016 14:55:01 +0200 + +pocl (0.13-5) unstable; urgency=medium + + * Build-depend on the llvm-3.8 release version. + * Update symbols files. + + -- Andreas Beckmann Mon, 11 Jul 2016 04:24:40 +0200 + +pocl (0.13-4) unstable; urgency=medium + + * Use CLOCK_UPTIME_FAST on kFreeBSD. + * Update symbols files. + * Upload to unstable. + + -- Andreas Beckmann Sun, 03 Jul 2016 16:17:52 +0200 + +pocl (0.13-3) experimental; urgency=medium + + * Switch to llvm 3.8. + * Update symbols files for amd64 and i386. + * Upload to experimental. + + -- Andreas Beckmann Wed, 22 Jun 2016 14:37:21 +0200 + +pocl (0.13-2) unstable; urgency=medium + + * Update symbols files. + * Upload to unstable. + + -- Andreas Beckmann Wed, 22 Jun 2016 11:40:19 +0200 + +pocl (0.13-1) experimental; urgency=medium + + * New upstream release. (Closes: #820480) + * Refresh llvm-system-libs.patch, new upstream only supports llvm 3.7/3.8. + * Remove fix-image-args.patch, fixed upstream. + * glibc-2.23.patch: New, add support for glibc 2.23. + * Update symbols files for amd64 and i386. + * Upload to experimental. + + -- Andreas Beckmann Wed, 15 Jun 2016 18:55:21 +0200 + +pocl (0.12-6) unstable; urgency=medium + + * Update symbols files. + * Upload to unstable. + + -- Andreas Beckmann Tue, 14 Jun 2016 20:11:10 +0200 + +pocl (0.12-5) experimental; urgency=medium + + * Switch to llvm 3.7. + * Update symbols files for amd64 and i386. + * Upload to experimental. + + -- Andreas Beckmann Thu, 09 Jun 2016 10:26:04 +0200 + +pocl (0.12-4) unstable; urgency=medium + + * Update symbols files. + + -- Andreas Beckmann Wed, 08 Jun 2016 02:36:14 +0200 + +pocl (0.12-3) unstable; urgency=medium + + * Fix OpenCL headers for GNU/Hurd. + * Update symbols files. + * Upload to unstable. + + -- Andreas Beckmann Sat, 28 May 2016 17:17:37 +0200 + +pocl (0.12-2) experimental; urgency=medium + + * Add B-D: sphinx-common for binary-arch builds with 'dh --with sphinxdoc'. + + -- Andreas Beckmann Tue, 10 May 2016 20:32:16 +0200 + +pocl (0.12-1) experimental; urgency=medium + + * New upstream release. + * Refresh patches. + * Update symbols files for amd64 and i386. + * Upload to experimental. + + -- Andreas Beckmann Mon, 09 May 2016 14:44:03 +0200 + +pocl (0.11-5) unstable; urgency=medium + + * Work around clang failing to find sys/cdefs.h on !linux. + + -- Andreas Beckmann Fri, 27 May 2016 12:29:56 +0200 + +pocl (0.11-4) unstable; urgency=medium + + * Add B-D: sphinx-common for binary-arch builds with 'dh --with sphinxdoc'. + + -- Andreas Beckmann Tue, 17 May 2016 12:45:38 +0200 + +pocl (0.11-3) unstable; urgency=medium + + * Update symbols files. + * Provide documentation package (pocl-doc), thanks to Ghislain Vaillant. + + -- Andreas Beckmann Sun, 08 May 2016 02:57:38 +0200 + +pocl (0.11-2) unstable; urgency=medium + + * Make the B-D on clang versioned to match llvm. + * Drop superfluous B-D. + * Fix testsuite failure on i386. (Closes: #822563) + * Switch back target cpu to pentium3 on any-i386. + * Fix arm64 detection. (Closes: #787686) + * Move libpocl1-common to section utils. + * Upload to unstable. + + -- Andreas Beckmann Wed, 27 Apr 2016 10:17:50 +0200 + +pocl (0.11-1) experimental; urgency=medium + + [ Vincent Danjean ] + * New upstream version (Closes: #795321) + * Switch to llvm-3.6 (Closes: #803652) + * Fix "FTBFS on arm64" by targeting llvm arch to cortex-a53 on arm64 + (Closes: #787686) + * Fix "vcs-browser field does not work" by fixing URL in debian/control + (Closes: #775844) + + [ Andreas Beckmann ] + * Use a temporary, writable $HOME while running the testsuite. + * Show the full tests/testsuite.log on testsuite failures. + * Drop the -dbg package in favor of autogenerated -dbgsym packages. + * Update symbols files for amd64 and i386. + * llvm-config --system-libs is only needed with static llvm. + * Fix detection of image and sampler arguments, thanks to James Price. + (Closes: #799322) + * Put package under "Debian OpenCL Maintainers" team maintenance. + * Add Vincent Danjean and myself to Uploaders. + * Bump Standards-Version to 3.9.8 (no changes needed). + + -- Andreas Beckmann Mon, 25 Apr 2016 09:49:29 +0200 + +pocl (0.10-12) experimental; urgency=medium + + * Update again symbol file for armel + * apply partial fix for armhf (only one test fail, due to neon instruction) + + -- Vincent Danjean Sun, 02 Nov 2014 01:36:13 +0100 + +pocl (0.10-11) experimental; urgency=medium + + * Correctly fix FreeBSD include + * Update symbols file + + -- Vincent Danjean Mon, 27 Oct 2014 12:31:47 +0100 + +pocl (0.10-10) unstable; urgency=medium + + * fix symbol file (again), perhaps due to previous target adjustment + * trying pentium-m (for i386) and nehalem (for freebsd-i386) as + processor target + + -- Vincent Danjean Sat, 25 Oct 2014 22:32:40 +0200 + +pocl (0.10-9) unstable; urgency=medium + + * fix symbol file (again) + * lowering armhf llvm target (cortex-a5 instead of cortex-a7) + The good one should be ARMv7-A but it does not exist in LLVM + https://wiki.debian.org/ArmHardFloatPort + * bumping i386 target (from i686 to pentium4) + => some officially Debian supported i386 systems wont work with + pocl + + -- Vincent Danjean Fri, 24 Oct 2014 14:20:00 +0200 + +pocl (0.10-8) unstable; urgency=medium + + * fix symbol file for other architecture (!amd64) + + -- Vincent Danjean Fri, 24 Oct 2014 08:09:48 +0200 + +pocl (0.10-7) unstable; urgency=medium + + * bump minimum arch on i386 (from i586 to i686) + * to not ignore failed testsuite anymore at build time + + -- Vincent Danjean Wed, 22 Oct 2014 21:07:51 +0200 + +pocl (0.10-6) unstable; urgency=medium + + * Fix OpenCL headers for i386 FreeBSD + * use pkg-kde-tools to handle C++ symbols + * Try to support more Debian architectures. + + -- Vincent Danjean Wed, 22 Oct 2014 12:31:11 +0200 + +pocl (0.10-5) unstable; urgency=medium + + * Fix arm configure.ac detection + * try to support more Debian architectures + + -- Vincent Danjean Tue, 21 Oct 2014 14:50:28 +0200 + +pocl (0.10-4) unstable; urgency=medium + + * No need to provide utlist.h that is already provided in the uthash-dev + package (Closes: #764571) + * Fix some glitches in descriptions + * Remove old unneeded patches + * Add clang-3.5 dependency for libpocl1 (required when running a kernel) + * Fix default host CPU for the OpenCL compiler + * Add info in build logs to help debugging + + -- Vincent Danjean Fri, 10 Oct 2014 22:23:38 +0200 + +pocl (0.10-3) unstable; urgency=medium + + * Move the manpage in the correct package + + -- Vincent Danjean Wed, 08 Oct 2014 00:03:28 +0200 + +pocl (0.10-2) unstable; urgency=medium + + * Fix URLs, project name and update the copyright list + (initially created in 2012 with 0.7 version) + + -- Vincent Danjean Mon, 06 Oct 2014 23:22:34 +0200 + +pocl (0.10-1) unstable; urgency=medium + + * Initial release. (Closes: #676504: ITP: pocl -- Portable OpenCL) + + -- Vincent Danjean Sun, 05 Oct 2014 21:15:18 +0200 diff --git a/clean b/clean new file mode 100644 index 0000000..1bfc841 --- /dev/null +++ b/clean @@ -0,0 +1,3 @@ +build-doc/ +debian/kcache/ +debian/stamp-failed-testsuite diff --git a/control b/control new file mode 100644 index 0000000..2e03a15 --- /dev/null +++ b/control @@ -0,0 +1,134 @@ +Source: pocl +Section: libs +Priority: optional +Maintainer: Debian OpenCL Maintainers +Uploaders: Vincent Danjean , + Andreas Beckmann , +Build-Depends: + debhelper-compat (= 13), + gcc (>= 4:10), + pkg-config, + libhwloc-dev, + ocl-icd-dev (>= 2.2.3), + ocl-icd-libopencl1 (>= 2.2.3), + ocl-icd-opencl-dev, + clang-9, + libclang-9-dev, + llvm-9-dev, + pkg-kde-tools, + cmake, + clinfo, +Build-Depends-Indep: + dh-sequence-sphinxdoc, + python3-sphinx, +Rules-Requires-Root: no +Standards-Version: 4.5.1 +Homepage: http://portablecl.org +Vcs-Browser: https://salsa.debian.org/opencl-team/pocl +Vcs-Git: https://salsa.debian.org/opencl-team/pocl.git + +Package: pocl-opencl-icd +Architecture: any +Multi-Arch: same +Depends: + libpocl2 (= ${binary:Version}), + ${misc:Depends} +Provides: + opencl-icd, + opencl-icd-1.1-1, + opencl-icd-1.2-1, +Description: pocl ICD + Portable Computing Language is an open source implementation of the OpenCL + standard which can be easily adapted for new targets. One of the goals of the + project is improving performance portability of OpenCL programs, avoiding the + need for target-dependent manual optimizations. A "native" target is included, + which allows running OpenCL kernels on the host (CPU). + . + This package allows one to use pocl as an installable client driver (ICD) for + OpenCL. + +Package: libpocl2-common +Architecture: all +Multi-Arch: foreign +Section: utils +Depends: + ${misc:Depends} +Breaks: + libpocl1-common, +Replaces: + libpocl1-common, +Description: common files for the pocl library + Portable Computing Language is an open source implementation of the OpenCL + standard which can be easily adapted for new targets. One of the goals of the + project is improving performance portability of OpenCL programs, avoiding the + need for target-dependent manual optimizations. A "native" target is included, + which allows running OpenCL kernels on the host (CPU). + . + This package provides the architecture independent files of the pocl library. + +Package: libpocl2 +Architecture: any +Multi-Arch: same +Pre-Depends: + ${misc:Pre-Depends} +Depends: + libpocl2-common (= ${source:Version}), + clang-${LLVM:Version}, + ${shlibs:Depends}, + ${misc:Depends} +Recommends: + pocl-opencl-icd, +Breaks: + libpocl1-common (<< 0.13-9), +Replaces: + libpocl1-common (<< 0.13-9), +Description: Portable Computing Language library + Portable Computing Language is an open source implementation of the OpenCL + standard which can be easily adapted for new targets. One of the goals of the + project is improving performance portability of OpenCL programs, avoiding the + need for target-dependent manual optimizations. A "native" target is included, + which allows running OpenCL kernels on the host (CPU). + . + This package provides the core of pocl. + +Package: libpocl-dev +Architecture: any +Section: libdevel +Depends: + libpocl2 (= ${binary:Version}), + ${shlibs:Depends}, + ${misc:Depends} +Description: development files for the pocl library + Portable Computing Language is an open source implementation of the OpenCL + standard which can be easily adapted for new targets. One of the goals of the + project is improving performance portability of OpenCL programs, avoiding the + need for target-dependent manual optimizations. A "native" target is included, + which allows running OpenCL kernels on the host (CPU). + . + This package provides the development files for the pocl library. Unless very + specific needs, this package is useless. This package is only required to link + directly and explicitly with pocl. + . + To develop OpenCL programs (that can be run with pocl), the opencl-dev virtual + package (provided by ocl-icd-opencl-dev for example) is required, not this one. + +Package: pocl-doc +Architecture: all +Multi-Arch: foreign +Section: doc +Depends: + ${sphinxdoc:Depends}, + ${misc:Depends} +Built-Using: ${sphinxdoc:Built-Using} +Description: documentation for the pocl library + Portable Computing Language is an open source implementation of the OpenCL + standard which can be easily adapted for new targets. One of the goals of the + project is improving performance portability of OpenCL programs, avoiding the + need for target-dependent manual optimizations. A "native" target is included, + which allows running OpenCL kernels on the host (CPU). + . + This package provides the development files for the pocl library. Unless very + specific needs, this package is useless. This package is only required to link + directly and explicitly with pocl. + . + This package provides the documentation for the pocl library. diff --git a/copyright b/copyright new file mode 100644 index 0000000..9ec0970 --- /dev/null +++ b/copyright @@ -0,0 +1,133 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Portable Computing Language +Source: http://portablecl.org/download.html + +Files: * +Copyright: 2012-2020 pocl developers + 2002-2019 Tampere University + 2011-2012 Carlos Sánchez de La Lama + 2011-2020 Pekka Jääskeläinen / Tampere University of Technology + 2011-2014 Kalle Raiskila + 2011-2014 Erik Schnetter + 2011-2015 Ville Korhonen / Tampere University of Technology + 2011-2015 Universidad Rey Juan Carlos + 2012-2017 Christian Rau + 2012 Cyril Roelandt + 2012 Timo Viitanen + 2013 Jesse Towner + 2013 Kalray + 2013 Victor Oliveira + 2014-2016 Advanced Micro Devices, Inc. + 2014 Felix Bytow + 2014 Lassi Koskinen + 2014-2015 Matias Koskela + 2014-2018 Michal Babej + 2015-2020 Giuseppe Bilotta + 2016 Tom Gall + 2016 Marc Andrysco + 2016-2017 James Price + 2017 Stephan Nolting + 2018 Julius Ikkala + 2020 Isuru Fernando +License: Expat + +Files: include/utlist.h +Copyright: 2007-2011, Troy D. Hanson http://uthash.sourceforge.net +License: Free-Software-2 + +Files: include/CL/*.h* +Copyright: 2008-2019 The Khronos Group Inc. +License: Free-Software-3 + +Files: lib/kernel/sleef/* +Copyright: 2010-2017 Naoki Shibata + 2010-2017 ARM Ltd. +License: Boost-1.0 + +Files: debian/* +Copyright: 2012 Vincent Danjean + © 2016-2021 Andreas Beckmann +License: Expat + +License: Expat + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + +License: Free-Software-2 + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: Free-Software-3 + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and/or associated documentation files (the + "Materials"), to deal in the Materials without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Materials, and to + permit persons to whom the Materials are furnished to do so, subject to + the following conditions: + . + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Materials. + . + THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + +License: Boost-1.0 + Boost Software License - Version 1.0 - August 17th, 2003 + . + Permission is hereby granted, free of charge, to any person or organization + obtaining a copy of the software and accompanying documentation covered by + this license (the "Software") to use, reproduce, display, distribute, + execute, and transmit the Software, and to prepare derivative works of the + Software, and to permit third-parties to whom the Software is furnished to + do so, all subject to the following: + . + The copyright notices in the Software and this entire statement, including + the above license grant, this restriction and the following disclaimer, + must be included in all copies of the Software, in whole or in part, and + all derivative works of the Software, unless such copies or derivative + works are solely in the form of machine-executable object code generated by + a source language processor. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT + SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE + FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. diff --git a/libpocl-dev.install b/libpocl-dev.install new file mode 100644 index 0000000..3919254 --- /dev/null +++ b/libpocl-dev.install @@ -0,0 +1,3 @@ +usr/bin +usr/lib/*/libpocl.so +usr/lib/*/pkgconfig/pocl.pc diff --git a/libpocl2-common.install b/libpocl2-common.install new file mode 100644 index 0000000..a8e36ee --- /dev/null +++ b/libpocl2-common.install @@ -0,0 +1 @@ +usr/share/pocl/include diff --git a/libpocl2.install b/libpocl2.install new file mode 100644 index 0000000..6fc0cea --- /dev/null +++ b/libpocl2.install @@ -0,0 +1,3 @@ +usr/lib/*/pocl +usr/lib/*/libpocl.*so.* +usr/share/pocl/*.bc diff --git a/libpocl2.lintian-overrides b/libpocl2.lintian-overrides new file mode 100644 index 0000000..6d898ad --- /dev/null +++ b/libpocl2.lintian-overrides @@ -0,0 +1,2 @@ +# we use fake Debian revisions to mark symbol (dis)appearance on compiler version changes +symbols-file-contains-debian-revision diff --git a/libpocl2.symbols b/libpocl2.symbols new file mode 100644 index 0000000..8447419 --- /dev/null +++ b/libpocl2.symbols @@ -0,0 +1,152 @@ +# SymbolsHelper-Confirmed: 1.6-2~hardening amd64 arm64 armel armhf hurd-i386 i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64 +libpocl-devices-basic.so #PACKAGE# #MINVER# + pocl_basic_init_device_ops@Base 1.6 +libpocl-devices-pthread.so #PACKAGE# #MINVER# + pocl_pthread_init_device_ops@Base 1.6 +libpocl.so.2 #PACKAGE# #MINVER# +* Build-Depends-Package: libpocl-dev +#MISSING: 0.11# Header@Base 0.10 +#MISSING: 0.11# KernelName@Base 0.10 + POclReleaseEvent@Base 1.6-5~visibility + POclRetainEvent@Base 1.6-5~visibility +#MISSING: 1.6-5~visibility# X@Base 0.13 +#MISSING: 1.6-5~visibility# Y@Base 0.10 + (optional=templinst)_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12emplace_backIJS5_EEEvDpOT_@Base 0.11 + (optional=templinst)_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJRKS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_@Base 0.13-9~llvm3.8+gcc7 + (optional=templinst)_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_@Base 0.13-9~llvm3.8+gcc7 + (optional=templinst)_ZNSt6vectorIPKcSaIS1_EE17_M_realloc_insertIJS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_@Base 0.13-9~llvm3.8+gcc7 + (optional=templinst|subst)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceE{size_t}{size_t}PKc{size_t}@Base 1.6-2~hardening + (optional=templinst|arch=mipsel)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag@Base 1.1-6~llvm6.0+gcc8 + (optional=templinst)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4swapERS4_@Base 1.6-2~hardening + (optional=templinst|subst)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_appendEPKc{size_t}@Base 1.6-2~hardening + (optional=templinst)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_assignERKS4_@Base 1.6-2~hardening + (optional=templinst|subst)_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_mutateE{size_t}{size_t}PKc{size_t}@Base 1.6-2~hardening + (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_St9_IdentityIS5_ESt4lessIS5_ESaIS5_EE24_M_get_insert_unique_posERKS5_@Base 1.0 + (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_St9_IdentityIS5_ESt4lessIS5_ESaIS5_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIS5_ERKS5_@Base 1.0 + (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_St9_IdentityIS5_ESt4lessIS5_ESaIS5_EE8_M_eraseEPSt13_Rb_tree_nodeIS5_E@Base 1.0 + (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_S5_ESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE8_M_eraseEPSt13_Rb_tree_nodeIS8_E@Base 1.1-2~llvm5.0 + (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_iESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE24_M_get_insert_unique_posERS7_@Base 0.11 + (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_iESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIS8_ERS7_@Base 0.11 + (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_jESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE24_M_get_insert_unique_posERS7_@Base 1.0 + (optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_jESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorIS8_ERS7_@Base 1.0 + (optional=templinst)_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_@Base 1.6-2~hardening + (arch=armel riscv64)_ZTIN9__gnu_cxx7__mutexE@Base 1.4-5~llvm9 + (arch=armel riscv64)_ZTISt11_Mutex_baseILN9__gnu_cxx12_Lock_policyE1EE@Base 0.10 + (arch=!armel !riscv64)_ZTISt11_Mutex_baseILN9__gnu_cxx12_Lock_policyE2EE@Base 0.10 + (arch=armel riscv64)_ZTISt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE1EE@Base 0.10 + (arch=!armel !riscv64)_ZTISt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE@Base 0.10 + (arch=armel armhf)_ZTISt19_Sp_make_shared_tag@Base 0.10 + (arch=armel riscv64)_ZTSN9__gnu_cxx7__mutexE@Base 1.0 + (arch=armel riscv64)_ZTSSt11_Mutex_baseILN9__gnu_cxx12_Lock_policyE1EE@Base 0.10 + (arch=!armel !riscv64)_ZTSSt11_Mutex_baseILN9__gnu_cxx12_Lock_policyE2EE@Base 0.10 + (arch=armel riscv64)_ZTSSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE1EE@Base 0.10 + (arch=!armel !riscv64)_ZTSSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE@Base 0.10 + _ZTSSt19_Sp_make_shared_tag@Base 0.10 + _ZZNSt19_Sp_make_shared_tag5_S_tiEvE5__tag@Base 1.1-8~llvm6.0+gcc8.2 +#MISSING: 0.14# check_compiler_cache@Base 0.10 + clGetExtensionFunctionAddress@Base 0.10 + clGetExtensionFunctionAddressForPlatform@Base 1.0 +#MISSING: 1.6-5~visibility# cl_context_count@Base 1.1 +#MISSING: 0.14~visibility# context_set_properties@Base 0.10 +#MISSING: 0.14# cpufreq_file@Base 0.10 +#MISSING: 0.14# cpuinfo@Base 0.10 +#MISSING: 1.0# create_workitem_aa_plugin@Base 0.10 + currentPoclDevice@Base 0.14 +#MISSING: 1.6-5~# fill_dev_image_t@Base 1.6 +#MISSING: 1.6-5~# fill_dev_sampler_t@Base 1.6 +#MISSING: 0.14# find_env@Base 0.10 +#MISSING: 0.14# get_cpu_name@Base 0.13 + get_llvm_cpu_name@Base 1.6 +#MISSING: 0.14~visibility# llvm_codegen@Base 0.10 +#MISSING: 0.12~visibility# pocl_SHA1_Final@Base 0.11 +#MISSING: 0.12~visibility# pocl_SHA1_Init@Base 0.11 +#MISSING: 0.12~visibility# pocl_SHA1_Update@Base 0.11 + pocl_aligned_malloc@Base 1.6 + pocl_aligned_malloc_global_mem@Base 1.6 +#MISSING: 0.12# pocl_basic_malloc@Base 0.11 +#MISSING: 0.13# pocl_basic_set_buffer_image_limits@Base 0.12 + pocl_broadcast@Base 1.6 + pocl_cache_work_group_function_path@Base 1.6-5~visibility + pocl_check_kernel_dlhandle_cache@Base 1.6 +#MISSING: 0.11~visibility# pocl_command_enqueue@Base 0.10 + pocl_command_push@Base 1.6 + pocl_command_to_str@Base 1.6-5~visibility +#MISSING: 0.14# pocl_compact_queue_list@Base 0.12 +#MISSING: 1.6~visibility# pocl_context_handling_lock@Base 1.1 +#MISSING: 0.14~visibility# pocl_cpufreq_get_max@Base 0.10 +#MISSING: 0.12# pocl_cpuinfo_append_cpu_name@Base 0.10 +#MISSING: 0.14~visibility# pocl_cpuinfo_detect_compute_unit_count@Base 0.10 + pocl_cpuinfo_detect_device_info@Base 1.6 +#MISSING: 0.14~visibility# pocl_cpuinfo_detect_max_clock_frequency@Base 0.10 +#MISSING: 0.14~visibility# pocl_cpuinfo_get_cpu_name_and_vendor@Base 0.12 +#MISSING: 1.6~visibility# pocl_cq_profiling_enabled@Base 1.5 +#MISSING: 1.6~visibility# pocl_cq_profiling_init@Base 1.5 +#MISSING: 1.6~visibility# pocl_cq_profiling_register_event@Base 1.5 +#MISSING: 0.11~visibility# pocl_create_command@Base 0.10 +#MISSING: 0.11~visibility# pocl_create_event@Base 0.10 +#MISSING: 0.12# pocl_debug_messages@Base 0.11 + pocl_debug_messages_filter@Base 1.6 + pocl_debug_output_lock@Base 1.6 + pocl_debug_output_unlock@Base 1.6 + pocl_debug_print_header@Base 1.6 +#MISSING: 0.12# pocl_debug_timespec@Base 0.11 + pocl_default_local_size_optimizer@Base 1.6 + pocl_device_get_env_count@Base 1.6 +#MISSING: 1.6-5~visibility# pocl_device_types@Base 1.6 + pocl_exec_command@Base 1.6 + pocl_exists@Base 1.6-5~visibility + pocl_fill_dev_image_t@Base 1.6-5~ + pocl_fill_dev_sampler_t@Base 1.6-5~ +#MISSING: 0.14# pocl_find_img_format@Base 0.10 +#MISSING: 0.14# pocl_finish_all_queues@Base 0.12 + pocl_free_global_mem@Base 1.6 +#MISSING: 0.14~visibility# pocl_free_llvm_irs@Base 0.12 + pocl_get_bool_option@Base 0.10 + pocl_get_int_option@Base 0.10 + pocl_get_string_option@Base 0.10 + pocl_gettimemono_ns@Base 1.6-5~visibility + pocl_init_default_device_infos@Base 1.6 + pocl_init_dlhandle_cache@Base 1.6 +#MISSING: 0.14~visibility# pocl_init_mem_manager@Base 0.10 +#MISSING: 1.6~visibility# pocl_is_option_set@Base 0.10 +#MISSING: 0.14~visibility# pocl_llvm_build_program@Base 0.10 +#MISSING: 0.14~visibility# pocl_llvm_codegen@Base 0.10 + pocl_llvm_generate_workgroup_function@Base 0.10 +#MISSING: 0.14~visibility# pocl_llvm_get_kernel_count@Base 0.12 +#MISSING: 0.14# pocl_llvm_get_kernel_metadata@Base 0.10 +#MISSING: 0.14# pocl_llvm_get_kernel_names@Base 0.10 +#MISSING: 0.14~visibility# pocl_llvm_update_binaries@Base 0.10 +#MISSING: 0.14# pocl_map_mem_cmd@Base 0.10 +#MISSING: 0.14~visibility# pocl_mem_manager_free_command@Base 0.10 +#MISSING: 0.14~visibility# pocl_mem_manager_free_event@Base 0.10 +#MISSING: 0.14~visibility# pocl_mem_manager_new_command@Base 0.10 +#MISSING: 0.14~visibility# pocl_mem_manager_new_event@Base 0.10 +#MISSING: 0.14~visibility# pocl_memalign_alloc@Base 0.11 +#MISSING: 0.14# pocl_memalign_alloc_global_mem@Base 0.13 + pocl_ndrange_node_cleanup@Base 1.6 +#MISSING: 0.14~visibility# pocl_print_system_memory_stats@Base 0.13 +#MISSING: 0.13# pocl_pthread_malloc@Base 0.11 +#MISSING: 0.14~visibility# pocl_rect_copy@Base 0.13 + pocl_release_dlhandle_cache@Base 1.6 + pocl_restore_ftz@Base 1.6 + pocl_restore_rm@Base 1.6 + pocl_save_ftz@Base 1.6 + pocl_save_rm@Base 1.6 + pocl_set_buffer_image_limits@Base 1.6 + pocl_set_default_rm@Base 1.6 + pocl_set_ftz@Base 1.6 +#MISSING: 0.14~visibility# pocl_setup_device_for_system_memory@Base 0.13 + pocl_stderr_is_a_tty@Base 1.6-5~ +#MISSING: 0.12# pocl_sysfs_detect_compute_unit_count@Base 0.11 + pocl_topology_detect_device_info@Base 1.6 + pocl_update_event_complete_msg@Base 1.6 + pocl_update_event_failed@Base 1.6 +#MISSING: 1.6-5~visibility# pocl_update_event_finished_msg@Base 1.4 + pocl_update_event_running@Base 1.6 + pocl_update_event_submitted@Base 1.6 +#MISSING: 0.14~visibility# pocl_update_program_llvm_irs@Base 0.11 + pocl_write_file@Base 1.6-5~visibility +#MISSING: 1.6~visibility# scheduler_initialized@Base 1.3 +#MISSING: 1.6-5~# stderr_is_a_tty@Base 1.6 +#MISSING: 0.12~visibility# supported_image_formats@Base 0.10 +#MISSING: 0.14# ta_pool_lock@Base 0.10 diff --git a/patches/0001-fix-build-on-hurd-i386.patch b/patches/0001-fix-build-on-hurd-i386.patch new file mode 100644 index 0000000..a69a22c --- /dev/null +++ b/patches/0001-fix-build-on-hurd-i386.patch @@ -0,0 +1,25 @@ +From 4d3c186c1db1755d1d0a9cb33cc37f8108fe45ae Mon Sep 17 00:00:00 2001 +From: Samuel Thibault +Date: Wed, 1 Jan 2020 15:19:44 +0100 +Subject: [PATCH 01/10] fix build on hurd-i386 + +--- + lib/CL/pocl_timing.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/CL/pocl_timing.c b/lib/CL/pocl_timing.c +index 8862da08..aec88ef0 100644 +--- a/lib/CL/pocl_timing.c ++++ b/lib/CL/pocl_timing.c +@@ -35,7 +35,7 @@ + # else + # include + # endif +-# ifdef __MACH__ ++# ifdef __APPLE__ + # include + # include + # endif +-- +2.20.1 + diff --git a/patches/0002-link-against-single-shared-libclang-cpp-when-buildin.patch b/patches/0002-link-against-single-shared-libclang-cpp-when-buildin.patch new file mode 100644 index 0000000..cef1ecd --- /dev/null +++ b/patches/0002-link-against-single-shared-libclang-cpp-when-buildin.patch @@ -0,0 +1,37 @@ +From 4c98e36ab636dd799772e3c8a2d9ddaaebaf64e2 Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Wed, 8 Apr 2020 01:33:12 +0200 +Subject: [PATCH 02/10] link against single shared libclang-cpp when building + with llvm 9, too + +--- + cmake/LLVM.cmake | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/cmake/LLVM.cmake b/cmake/LLVM.cmake +index 51b051c2..cc66096d 100644 +--- a/cmake/LLVM.cmake ++++ b/cmake/LLVM.cmake +@@ -243,8 +243,8 @@ string(STRIP "${LLVM_SYSLIBS}" LLVM_SYSLIBS) + #################################################################### + + # llvm-config does not include clang libs +-if((9 LESS LLVM_MAJOR) AND (NOT STATIC_LLVM)) +- # For Clang 10+, link against a single shared library instead of multiple component shared ++if((8 LESS LLVM_MAJOR) AND (NOT STATIC_LLVM)) ++ # For Clang 9+, link against a single shared library instead of multiple component shared + # libraries. + if("${LLVM_LIBNAMES}" MATCHES "LLVMTCE") + set(CLANG_LIBNAMES clangTCE-cpp) +@@ -261,7 +261,7 @@ endif() + foreach(LIBNAME ${CLANG_LIBNAMES}) + find_library(C_LIBFILE_${LIBNAME} NAMES "${LIBNAME}" HINTS "${LLVM_LIBDIR}") + list(APPEND CLANG_LIBFILES "${C_LIBFILE_${LIBNAME}}") +- if(UNIX AND (NOT APPLE)) ++ if(UNIX AND (NOT APPLE) AND (NOT ((8 LESS LLVM_MAJOR) AND (NOT STATIC_LLVM)))) + set(LLVM_LDFLAGS "${LLVM_LDFLAGS} -Wl,--exclude-libs,lib${LIBNAME}") + endif() + endforeach() +-- +2.20.1 + diff --git a/patches/0003-rename-stderr_is_a_tty-to-pocl_stderr_is_a_tty.patch b/patches/0003-rename-stderr_is_a_tty-to-pocl_stderr_is_a_tty.patch new file mode 100644 index 0000000..fd408af --- /dev/null +++ b/patches/0003-rename-stderr_is_a_tty-to-pocl_stderr_is_a_tty.patch @@ -0,0 +1,110 @@ +From 4c957ca65e1cdf121421ec445445613d2f980436 Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Wed, 3 Feb 2021 23:42:33 +0100 +Subject: [PATCH 03/10] rename stderr_is_a_tty to pocl_stderr_is_a_tty + +--- + lib/CL/devices/devices.c | 2 +- + lib/CL/pocl_debug.c | 18 +++++++++--------- + lib/CL/pocl_debug.h | 4 ++-- + 3 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/lib/CL/devices/devices.c b/lib/CL/devices/devices.c +index 9bf622f4..77a1eaa5 100644 +--- a/lib/CL/devices/devices.c ++++ b/lib/CL/devices/devices.c +@@ -531,7 +531,7 @@ pocl_init_devices () + #ifdef POCL_DEBUG_MESSAGES + const char* debug = pocl_get_string_option ("POCL_DEBUG", "0"); + pocl_debug_messages_setup (debug); +- stderr_is_a_tty = isatty(fileno(stderr)); ++ pocl_stderr_is_a_tty = isatty(fileno(stderr)); + #endif + + POCL_GOTO_ERROR_ON ((pocl_cache_init_topdir ()), CL_DEVICE_NOT_FOUND, +diff --git a/lib/CL/pocl_debug.c b/lib/CL/pocl_debug.c +index e16eaed2..7ed23724 100644 +--- a/lib/CL/pocl_debug.c ++++ b/lib/CL/pocl_debug.c +@@ -11,7 +11,7 @@ + #ifdef POCL_DEBUG_MESSAGES + + uint64_t pocl_debug_messages_filter; /* Bitfield */ +-int stderr_is_a_tty; ++int pocl_stderr_is_a_tty; + + static pthread_mutex_t console_mutex = PTHREAD_MUTEX_INITIALIZER; + +@@ -100,15 +100,15 @@ static pthread_mutex_t console_mutex = PTHREAD_MUTEX_INITIALIZER; + const char *formatstring; + + if (filter_type == POCL_FILTER_TYPE_ERR) +- filter_type_str = (stderr_is_a_tty ? POCL_COLOR_RED : " *** ERROR *** "); ++ filter_type_str = (pocl_stderr_is_a_tty ? POCL_COLOR_RED : " *** ERROR *** "); + else if (filter_type == POCL_FILTER_TYPE_WARN) +- filter_type_str = (stderr_is_a_tty ? POCL_COLOR_YELLOW : " *** WARNING *** "); ++ filter_type_str = (pocl_stderr_is_a_tty ? POCL_COLOR_YELLOW : " *** WARNING *** "); + else if (filter_type == POCL_FILTER_TYPE_INFO) +- filter_type_str = (stderr_is_a_tty ? POCL_COLOR_GREEN : " *** INFO *** "); ++ filter_type_str = (pocl_stderr_is_a_tty ? POCL_COLOR_GREEN : " *** INFO *** "); + else +- filter_type_str = (stderr_is_a_tty ? POCL_COLOR_GREEN : " *** UNKNOWN *** "); ++ filter_type_str = (pocl_stderr_is_a_tty ? POCL_COLOR_GREEN : " *** UNKNOWN *** "); + +- if (stderr_is_a_tty) ++ if (pocl_stderr_is_a_tty) + formatstring = POCL_COLOR_BLUE + "[%04i-%02i-%02i %02i:%02i:%02i.%09li]" + POCL_COLOR_RESET "POCL: in fn %s " +@@ -143,7 +143,7 @@ static pthread_mutex_t console_mutex = PTHREAD_MUTEX_INITIALIZER; + if (!(pocl_debug_messages_filter & POCL_DEBUG_FLAG_TIMING)) + return; + const char* formatstring; +- if (stderr_is_a_tty) ++ if (pocl_stderr_is_a_tty) + formatstring = " >>> " POCL_COLOR_MAGENTA " %3" PRIu64 + ".%03" PRIu64 " " POCL_COLOR_RESET " %s %s\n"; + else +@@ -157,7 +157,7 @@ static pthread_mutex_t console_mutex = PTHREAD_MUTEX_INITIALIZER; + if ((sec == 0) && (nsec < 1000)) + { + b = nsec % 1000; +- if (stderr_is_a_tty) ++ if (pocl_stderr_is_a_tty) + formatstring = " >>> " POCL_COLOR_MAGENTA + " %3" PRIu64 " " POCL_COLOR_RESET " ns %s\n"; + else +@@ -178,7 +178,7 @@ static pthread_mutex_t console_mutex = PTHREAD_MUTEX_INITIALIZER; + } + else + { +- if (stderr_is_a_tty) ++ if (pocl_stderr_is_a_tty) + formatstring = " >>> " POCL_COLOR_MAGENTA " %3" PRIu64 + ".%09" PRIu64 " " POCL_COLOR_RESET " %s %s\n"; + else +diff --git a/lib/CL/pocl_debug.h b/lib/CL/pocl_debug.h +index 9b9f9058..f9521591 100644 +--- a/lib/CL/pocl_debug.h ++++ b/lib/CL/pocl_debug.h +@@ -110,7 +110,7 @@ extern "C" { + #ifdef POCL_DEBUG_MESSAGES + + extern uint64_t pocl_debug_messages_filter; +- extern int stderr_is_a_tty; ++ extern int pocl_stderr_is_a_tty; + + #define POCL_DEBUGGING_ON (pocl_debug_messages_filter) + +@@ -148,7 +148,7 @@ extern "C" { + if (pocl_debug_messages_filter & POCL_DEBUG_FLAG_ ## FILTER) { \ + pocl_debug_output_lock (); \ + POCL_DEBUG_HEADER(FILTER, POCL_FILTER_TYPE_ ## TYPE) \ +- if (stderr_is_a_tty) \ ++ if (pocl_stderr_is_a_tty) \ + fprintf (stderr, "%s", POCL_COLOR_BOLDRED \ + ERRCODE " " POCL_COLOR_RESET); \ + else \ +-- +2.20.1 + diff --git a/patches/0004-rename-fill_dev_-_t-to-pocl_fill_dev_-_t.patch b/patches/0004-rename-fill_dev_-_t-to-pocl_fill_dev_-_t.patch new file mode 100644 index 0000000..56957f8 --- /dev/null +++ b/patches/0004-rename-fill_dev_-_t-to-pocl_fill_dev_-_t.patch @@ -0,0 +1,101 @@ +From 6942a2b200e1e8018a900481b4b53378c32818a7 Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Wed, 3 Feb 2021 23:44:08 +0100 +Subject: [PATCH 04/10] rename fill_dev_*_t to pocl_fill_dev_*_t + +--- + lib/CL/devices/basic/basic.c | 4 ++-- + lib/CL/devices/common.c | 6 +++--- + lib/CL/devices/common.h | 6 +++--- + lib/CL/devices/pthread/pthread_utils.c | 4 ++-- + 4 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/lib/CL/devices/basic/basic.c b/lib/CL/devices/basic/basic.c +index 0fbae01c..5022970a 100644 +--- a/lib/CL/devices/basic/basic.c ++++ b/lib/CL/devices/basic/basic.c +@@ -377,7 +377,7 @@ pocl_basic_run (void *data, _cl_command_node *cmd) + else if (meta->arg_info[i].type == POCL_ARG_TYPE_IMAGE) + { + dev_image_t di; +- fill_dev_image_t (&di, al, cmd->device); ++ pocl_fill_dev_image_t (&di, al, cmd->device); + + void *devptr = pocl_aligned_malloc (MAX_EXTENDED_ALIGNMENT, + sizeof (dev_image_t)); +@@ -388,7 +388,7 @@ pocl_basic_run (void *data, _cl_command_node *cmd) + else if (meta->arg_info[i].type == POCL_ARG_TYPE_SAMPLER) + { + dev_sampler_t ds; +- fill_dev_sampler_t(&ds, al); ++ pocl_fill_dev_sampler_t (&ds, al); + arguments[i] = malloc (sizeof (void *)); + *(void **)(arguments[i]) = (void *)ds; + } +diff --git a/lib/CL/devices/common.c b/lib/CL/devices/common.c +index 274cacb1..a62eca66 100644 +--- a/lib/CL/devices/common.c ++++ b/lib/CL/devices/common.c +@@ -261,8 +261,8 @@ FINISH: + * from given kernel image argument + */ + void +-fill_dev_image_t (dev_image_t* di, struct pocl_argument* parg, +- cl_device_id device) ++pocl_fill_dev_image_t (dev_image_t *di, struct pocl_argument *parg, ++ cl_device_id device) + { + cl_mem mem = *(cl_mem *)parg->value; + di->_width = mem->image_width; +@@ -791,7 +791,7 @@ pocl_broadcast (cl_event brc_event) + * from given kernel sampler argument + */ + void +-fill_dev_sampler_t (dev_sampler_t *ds, struct pocl_argument *parg) ++pocl_fill_dev_sampler_t (dev_sampler_t *ds, struct pocl_argument *parg) + { + cl_sampler sampler = *(cl_sampler *)parg->value; + +diff --git a/lib/CL/devices/common.h b/lib/CL/devices/common.h +index e9a6bca9..239e69c4 100644 +--- a/lib/CL/devices/common.h ++++ b/lib/CL/devices/common.h +@@ -64,10 +64,10 @@ int llvm_codegen (char *output, unsigned device_i, cl_kernel kernel, + cl_device_id device, _cl_command_node *command, + int specialize); + +-void fill_dev_image_t (dev_image_t *di, struct pocl_argument *parg, +- cl_device_id device); ++void pocl_fill_dev_image_t (dev_image_t *di, struct pocl_argument *parg, ++ cl_device_id device); + +-void fill_dev_sampler_t (dev_sampler_t *ds, struct pocl_argument *parg); ++void pocl_fill_dev_sampler_t (dev_sampler_t *ds, struct pocl_argument *parg); + + void pocl_copy_mem_object (cl_device_id dest_dev, cl_mem dest, + size_t dest_offset, +diff --git a/lib/CL/devices/pthread/pthread_utils.c b/lib/CL/devices/pthread/pthread_utils.c +index 98e0144a..2b98274c 100644 +--- a/lib/CL/devices/pthread/pthread_utils.c ++++ b/lib/CL/devices/pthread/pthread_utils.c +@@ -146,7 +146,7 @@ setup_kernel_arg_array (kernel_run_command *k) + else if (meta->arg_info[i].type == POCL_ARG_TYPE_IMAGE) + { + dev_image_t di; +- fill_dev_image_t(&di, al, k->device); ++ pocl_fill_dev_image_t (&di, al, k->device); + void *devptr = pocl_aligned_malloc (MAX_EXTENDED_ALIGNMENT, + sizeof (dev_image_t)); + arguments[i] = &arguments2[i]; +@@ -156,7 +156,7 @@ setup_kernel_arg_array (kernel_run_command *k) + else if (meta->arg_info[i].type == POCL_ARG_TYPE_SAMPLER) + { + dev_sampler_t ds; +- fill_dev_sampler_t(&ds, al); ++ pocl_fill_dev_sampler_t (&ds, al); + + arguments[i] = &arguments2[i]; + arguments2[i] = (void *)ds; +-- +2.20.1 + diff --git a/patches/0005-handle-dlsym-error-on-device-library.patch b/patches/0005-handle-dlsym-error-on-device-library.patch new file mode 100644 index 0000000..3f5316b --- /dev/null +++ b/patches/0005-handle-dlsym-error-on-device-library.patch @@ -0,0 +1,42 @@ +From 75861950942ee2c3d0cdfbd7c9b5886e33e93470 Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Fri, 5 Feb 2021 16:01:50 +0100 +Subject: [PATCH 05/10] handle dlsym error on device library + +--- + lib/CL/devices/devices.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/lib/CL/devices/devices.c b/lib/CL/devices/devices.c +index 77a1eaa5..9c1fc6fa 100644 +--- a/lib/CL/devices/devices.c ++++ b/lib/CL/devices/devices.c +@@ -595,11 +595,23 @@ pocl_init_devices () + { + pocl_devices_init_ops[i] = (init_device_ops)dlsym ( + pocl_device_handles[i], init_device_ops_name); +- pocl_devices_init_ops[i](&pocl_device_ops[i]); ++ if (pocl_devices_init_ops[i] != NULL) ++ { ++ pocl_devices_init_ops[i](&pocl_device_ops[i]); ++ } ++ else ++ { ++ POCL_MSG_ERR ("Loading symbol %s from %s failed: %s\n", ++ init_device_ops_name, device_library, ++ dlerror ()); ++ device_count[i] = 0; ++ continue; ++ } + } + else + { +- POCL_MSG_WARN ("Loading %s failed.\n", device_library); ++ POCL_MSG_WARN ("Loading %s failed: %s\n", device_library, ++ dlerror ()); + device_count[i] = 0; + continue; + } +-- +2.20.1 + diff --git a/patches/0006-check-whether-libpocl-and-the-device-libraries-can-b.patch b/patches/0006-check-whether-libpocl-and-the-device-libraries-can-b.patch new file mode 100644 index 0000000..dc0795c --- /dev/null +++ b/patches/0006-check-whether-libpocl-and-the-device-libraries-can-b.patch @@ -0,0 +1,146 @@ +From ffdac91c1945aa69e43188e1647c25dc78e6bd5d Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Fri, 5 Feb 2021 16:23:39 +0100 +Subject: [PATCH 06/10] check whether libpocl and the device libraries can be + dlopen()ed + +--- + tests/CMakeLists.txt | 35 ++++++++++++++++++++ + tests/runtime/CMakeLists.txt | 4 +++ + tests/runtime/test_dlopen.c | 63 ++++++++++++++++++++++++++++++++++++ + 3 files changed, 102 insertions(+) + create mode 100644 tests/runtime/test_dlopen.c + +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index ed422d80..07648a00 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -38,6 +38,41 @@ endif() + + ####################################################################### + ++add_test("pocl_test_dlopen_libpocl" "runtime/test_dlopen") ++set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_libpocl") ++ ++if(BUILD_BASIC) ++ add_test("pocl_test_dlopen_device_basic" "runtime/test_dlopen" "basic") ++ set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_basic") ++endif() ++ ++if(BUILD_PTHREAD) ++ add_test("pocl_test_dlopen_device_pthread" "runtime/test_dlopen" "pthread") ++ set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_pthread") ++endif() ++ ++if(BUILD_ACCEL) ++ add_test("pocl_test_dlopen_device_accel" "runtime/test_dlopen" "accel") ++ set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_accel") ++endif() ++ ++if(ENABLE_TCE) ++ add_test("pocl_test_dlopen_device_tce" "runtime/test_dlopen" "tce") ++ set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_tce") ++endif() ++ ++if(ENABLE_HSA) ++ add_test("pocl_test_dlopen_device_hsa" "runtime/test_dlopen" "hsa") ++ set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_hsa") ++endif() ++ ++if(ENABLE_CUDA) ++ add_test("pocl_test_dlopen_device_cuda" "runtime/test_dlopen" "cuda") ++ set_property(TEST "pocl_version_check" APPEND PROPERTY DEPENDS "pocl_test_dlopen_device_cuda") ++endif() ++ ++####################################################################### ++ + add_subdirectory("kernel") + add_subdirectory("regression") + add_subdirectory("runtime") +diff --git a/tests/runtime/CMakeLists.txt b/tests/runtime/CMakeLists.txt +index 4dc9d9dd..4a9436a2 100644 +--- a/tests/runtime/CMakeLists.txt ++++ b/tests/runtime/CMakeLists.txt +@@ -24,6 +24,10 @@ + #============================================================================= + + ++# do not link test_dlopen with -lOpenCL ++add_executable("test_dlopen" "test_dlopen.c") ++target_link_libraries("test_dlopen" ${DL_LIB}) ++ + set(PROGRAMS_TO_BUILD test_clFinish test_clGetDeviceInfo test_clGetEventInfo + test_clCreateProgramWithBinary test_clGetSupportedImageFormats + test_clSetEventCallback test_clEnqueueNativeKernel test_clBuildProgram +diff --git a/tests/runtime/test_dlopen.c b/tests/runtime/test_dlopen.c +new file mode 100644 +index 00000000..be4bf5eb +--- /dev/null ++++ b/tests/runtime/test_dlopen.c +@@ -0,0 +1,63 @@ ++/* Test that pocl libraries can be dlopen()ed ++ ++ Copyright (c) 2021 pocl developers ++ ++ Permission is hereby granted, free of charge, to any person obtaining a copy ++ of this software and associated documentation files (the "Software"), to ++ deal in the Software without restriction, including without limitation the ++ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or ++ sell copies of the Software, and to permit persons to whom the Software is ++ furnished to do so, subject to the following conditions: ++ ++ The above copyright notice and this permission notice shall be included in ++ all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS ++ IN THE SOFTWARE. ++*/ ++ ++#include ++#include ++ ++int ++main (int argc, char **argv) ++{ ++ int ret = 0; ++ const char *libpocl = "$ORIGIN/../../lib/CL/libpocl.so"; ++ char libdevice[4096] = ""; ++ if (argc > 1) ++ snprintf (libdevice, sizeof (libdevice), ++ "$ORIGIN/../../lib/CL/devices/%s/libpocl-devices-%s.so", argv[1], ++ argv[1]); ++ ++ void *handle_libpocl = dlopen (libpocl, RTLD_NOW | RTLD_GLOBAL); ++ if (!handle_libpocl) ++ { ++ fprintf (stderr, "dlopen(%s, RTLD_NOW | RTLD_GLOBAL) failed: %s\n", ++ libpocl, dlerror ()); ++ ret = 1; ++ } ++ ++ if (ret == 0 && argc > 1) ++ { ++ void *handle_device = dlopen (libdevice, RTLD_NOW); ++ if (!handle_device) ++ { ++ fprintf (stderr, "dlopen(%s, RTLD_NOW) failed: %s\n", libdevice, ++ dlerror ()); ++ ret = 1; ++ } ++ if (handle_device) ++ dlclose (handle_device); ++ } ++ ++ if (handle_libpocl) ++ dlclose (handle_libpocl); ++ ++ return ret; ++} +-- +2.20.1 + diff --git a/patches/0007-drop-redundant-include.patch b/patches/0007-drop-redundant-include.patch new file mode 100644 index 0000000..79db9c0 --- /dev/null +++ b/patches/0007-drop-redundant-include.patch @@ -0,0 +1,27 @@ +From 9fcac421e3e39057108e109c7473bce05d04b726 Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Fri, 5 Feb 2021 17:46:49 +0100 +Subject: [PATCH 07/10] drop redundant #include + +--- + lib/CL/pocl_debug.h | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/lib/CL/pocl_debug.h b/lib/CL/pocl_debug.h +index f9521591..718cc391 100644 +--- a/lib/CL/pocl_debug.h ++++ b/lib/CL/pocl_debug.h +@@ -103,10 +103,6 @@ extern "C" { + *errcode_ret = CL_SUCCESS; \ + } } while (0) + +- +- +-#include "config.h" +- + #ifdef POCL_DEBUG_MESSAGES + + extern uint64_t pocl_debug_messages_filter; +-- +2.20.1 + diff --git a/patches/0008-drop-unused-global-variable-pocl_num_device_types.patch b/patches/0008-drop-unused-global-variable-pocl_num_device_types.patch new file mode 100644 index 0000000..654a969 --- /dev/null +++ b/patches/0008-drop-unused-global-variable-pocl_num_device_types.patch @@ -0,0 +1,24 @@ +From 5b533a7c01f57cce8674a5a907e88f039ecec87a Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Fri, 5 Feb 2021 17:47:39 +0100 +Subject: [PATCH 08/10] drop unused global variable pocl_num_device_types + +--- + lib/CL/devices/devices.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/lib/CL/devices/devices.c b/lib/CL/devices/devices.c +index 9c1fc6fa..1b26f3a8 100644 +--- a/lib/CL/devices/devices.c ++++ b/lib/CL/devices/devices.c +@@ -80,7 +80,6 @@ + /* the enabled devices */ + static struct _cl_device_id* pocl_devices = NULL; + unsigned int pocl_num_devices = 0; +-unsigned int pocl_num_device_types = 0; + + /* Init function prototype */ + typedef void (*init_device_ops)(struct pocl_device_ops*); +-- +2.20.1 + diff --git a/patches/0009-regroup-workgroup-tests-and-add-missing-dependencies.patch b/patches/0009-regroup-workgroup-tests-and-add-missing-dependencies.patch new file mode 100644 index 0000000..421c037 --- /dev/null +++ b/patches/0009-regroup-workgroup-tests-and-add-missing-dependencies.patch @@ -0,0 +1,122 @@ +From 256f15677bad062a64c72dd276bd8d84c274e841 Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Fri, 5 Feb 2021 22:22:26 +0100 +Subject: [PATCH 09/10] regroup workgroup tests and add missing dependencies on + pocl_version_check + +--- + examples/vecadd/CMakeLists.txt | 4 ++- + tests/workgroup/CMakeLists.txt | 50 ++++++++++++++++++---------------- + 2 files changed, 29 insertions(+), 25 deletions(-) + +diff --git a/examples/vecadd/CMakeLists.txt b/examples/vecadd/CMakeLists.txt +index cc13789f..ba52beb4 100644 +--- a/examples/vecadd/CMakeLists.txt ++++ b/examples/vecadd/CMakeLists.txt +@@ -42,7 +42,9 @@ if(NOT ENABLE_ANYSAN) + PASS_REGULAR_EXPRESSION "OK") + endif() + +-set_tests_properties( "examples/vecadd" ++set_tests_properties( ++ "examples/vecadd" ++ "examples/vecadd_large_grid" + PROPERTIES + COST 3.0 + ${PROPS} +diff --git a/tests/workgroup/CMakeLists.txt b/tests/workgroup/CMakeLists.txt +index 2b8435c5..c66f4ad8 100644 +--- a/tests/workgroup/CMakeLists.txt ++++ b/tests/workgroup/CMakeLists.txt +@@ -38,10 +38,6 @@ add_test_pocl(NAME "workgroup/different_implicit_barrier_injection_scenarios" + EXPECTED_OUTPUT "implicit_barriers_1_2_1_1.stdout" + COMMAND "run_kernel" "implicit_barriers.cl" 1 2 1 1) + +-add_test_pocl(NAME "workgroup/unconditional_barriers" +- EXPECTED_OUTPUT "basic_barriers_2_2_2_2.stdout" +- COMMAND "run_kernel" "basic_barriers.cl" 2 2 2 2) +- + add_test_pocl(NAME "workgroup/unbarriered_for_loops" + EXPECTED_OUTPUT "forloops_2_2_1_1.stdout" + COMMAND "run_kernel" "forloops.cl" 2 2 1 1) +@@ -54,10 +50,6 @@ add_test_pocl(NAME "workgroup/switch_case" + EXPECTED_OUTPUT "switch_case_1_4_1_1.stdout" + COMMAND "run_kernel" "switch_case.cl" 1 4 1 1) + +-add_test_pocl(NAME "workgroup/conditional_barrier" +- EXPECTED_OUTPUT "cond_barriers_1_2_1_1.stdout" +- COMMAND "run_kernel" "conditional_barriers.cl" 1 2 1 1) +- + add_test_pocl(NAME "workgroup/b_loop_with_none_of_the_WIs_reaching_the_barrier" + EXPECTED_OUTPUT "tricky_for_1_2_1_1.stdout" + COMMAND "run_kernel" "tricky_for.cl" 1 2 1 1) +@@ -66,6 +58,30 @@ add_test_pocl(NAME "workgroup/for_with_divergent_return" + EXPECTED_OUTPUT "for_with_divergent_return_1_6_1_1.stdout" + COMMAND "run_kernel" "for_with_divergent_return.cl" 1 6 1 1) + ++# Cases which are not dependent on the work-group or work-item ++# execution (printout) order or the method (use the default method ++# for the device). ++set_tests_properties( ++ "workgroup/different_implicit_barrier_injection_scenarios" ++ "workgroup/unbarriered_for_loops" ++ "workgroup/barriered_for_loops" ++ "workgroup/switch_case" ++ "workgroup/b_loop_with_none_of_the_WIs_reaching_the_barrier" ++ "workgroup/for_with_divergent_return" ++ PROPERTIES ++ COST 2.0 ++ PROCESSORS 1 ++ DEPENDS "pocl_version_check" ++ LABELS "internal;workgroup") ++ ++add_test_pocl(NAME "workgroup/unconditional_barriers" ++ EXPECTED_OUTPUT "basic_barriers_2_2_2_2.stdout" ++ COMMAND "run_kernel" "basic_barriers.cl" 2 2 2 2) ++ ++add_test_pocl(NAME "workgroup/conditional_barrier" ++ EXPECTED_OUTPUT "cond_barriers_1_2_1_1.stdout" ++ COMMAND "run_kernel" "conditional_barriers.cl" 1 2 1 1) ++ + add_test_pocl(NAME "workgroup/forcing_horizontal_parallelization_to_some_outer_loops" + EXPECTED_OUTPUT "outerlooppar_2_2_1_1.stdout" + COMMAND "run_kernel" "outerlooppar.cl" 2 2 1 1) +@@ -98,7 +114,8 @@ add_test_pocl(NAME "workgroup/range_md_large_grid" + # These tests are now always ran with the basic device with a predefined + # work-group execution order. Their printout verification depends + # on it. +-set_tests_properties( "workgroup/unconditional_barriers" ++set_tests_properties( ++ "workgroup/unconditional_barriers" + "workgroup/conditional_barrier" + "workgroup/forcing_horizontal_parallelization_to_some_outer_loops" + "workgroup/loop_with_two_paths_to_the_latch" +@@ -110,25 +127,10 @@ set_tests_properties( "workgroup/unconditional_barriers" + PROPERTIES + COST 2.0 + PROCESSORS 1 +- LABELS "workgroup" + ENVIRONMENT "POCL_DEVICES=basic;POCL_WORK_GROUP_METHOD=workitemloops" + DEPENDS "pocl_version_check" + LABELS "internal;workgroup") + +-# Cases which are not dependent on the work-group or work-item +-# execution (printout) order or the method (use the default method +-# for the device). +-set_tests_properties("workgroup/unbarriered_for_loops" +- "workgroup/barriered_for_loops" +- "workgroup/switch_case" +- "workgroup/b_loop_with_none_of_the_WIs_reaching_the_barrier" +- PROPERTIES +- COST 2.0 +- PROCESSORS 1 +- LABELS "workgroup" +- DEPENDS "pocl_version_check" +- LABELS "internal;workgroup") +- + set_property(TEST + "workgroup/unconditional_barriers" + "workgroup/unbarriered_for_loops" +-- +2.20.1 + diff --git a/patches/0010-minor-cleanup.patch b/patches/0010-minor-cleanup.patch new file mode 100644 index 0000000..5bd7fc3 --- /dev/null +++ b/patches/0010-minor-cleanup.patch @@ -0,0 +1,51 @@ +From 7c9efe384425e56d3168822a85321b2abd2ab87c Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Fri, 5 Feb 2021 22:26:51 +0100 +Subject: [PATCH 10/10] minor cleanup + +--- + cmake/LLVM.cmake | 1 + + lib/CL/devices/devices.h | 1 - + lib/CL/pocl_cache.c | 2 +- + 3 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/cmake/LLVM.cmake b/cmake/LLVM.cmake +index cc66096d..3131ddd5 100644 +--- a/cmake/LLVM.cmake ++++ b/cmake/LLVM.cmake +@@ -735,6 +735,7 @@ if(NOT DEFINED CLANG_MARCH_FLAG) + message(FATAL_ERROR "Could not determine whether to use -march or -mcpu with clang") + endif() + endif() ++ message(STATUS " Using ${CLANG_MARCH_FLAG}") + + set(CLANG_MARCH_FLAG ${CLANG_MARCH_FLAG} CACHE INTERNAL "Clang option used to specify the target cpu") + endif() +diff --git a/lib/CL/devices/devices.h b/lib/CL/devices/devices.h +index 2c8c2222..bbb0a663 100644 +--- a/lib/CL/devices/devices.h ++++ b/lib/CL/devices/devices.h +@@ -70,7 +70,6 @@ unsigned int pocl_get_devices(cl_device_type device_type, struct _cl_device_id * + */ + int pocl_device_get_env_count(const char *dev_type); + +- + /** + * \brief Unique global memory id for devices with distinct memory from the system memory + * \return Unique global mem id, id > 0. Zero is reserved for shared system memory +diff --git a/lib/CL/pocl_cache.c b/lib/CL/pocl_cache.c +index b3d9caa3..e9dc9958 100644 +--- a/lib/CL/pocl_cache.c ++++ b/lib/CL/pocl_cache.c +@@ -517,7 +517,7 @@ pocl_cache_init_topdir () + "library. \nThis is not a bug in pocl and there's nothing we " + "can do to fix it - you need both pocl and your program to be" + " compiled for your system. This is known to happen with " +- "Luxmark benchmark binaries dowloaded from website; Luxmark " ++ "Luxmark benchmark binaries downloaded from website; Luxmark " + "installed from your linux distribution's packages should " + "work.\n", + cache_topdir); +-- +2.20.1 + diff --git a/patches/0011-add-include-pocl_export.h-for-new-macro-POCL_EXPORT.patch b/patches/0011-add-include-pocl_export.h-for-new-macro-POCL_EXPORT.patch new file mode 100644 index 0000000..5e6ea2c --- /dev/null +++ b/patches/0011-add-include-pocl_export.h-for-new-macro-POCL_EXPORT.patch @@ -0,0 +1,52 @@ +From e315cb814212e0e3c4b3dbeccbdd44f1aea87efe Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Fri, 5 Feb 2021 17:53:19 +0100 +Subject: [PATCH 11/13] add include/pocl_export.h for new macro POCL_EXPORT + +--- + include/pocl_export.h | 33 +++++++++++++++++++++++++++++++++ + 1 file changed, 33 insertions(+) + create mode 100644 include/pocl_export.h + +diff --git a/include/pocl_export.h b/include/pocl_export.h +new file mode 100644 +index 00000000..e9c5efac +--- /dev/null ++++ b/include/pocl_export.h +@@ -0,0 +1,33 @@ ++/* pocl_export.h: macros for symbol visibility ++ ++ Copyright (c) 2021 pocl developers ++ ++ Permission is hereby granted, free of charge, to any person obtaining a copy ++ of this software and associated documentation files (the "Software"), to ++ deal in the Software without restriction, including without limitation the ++ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or ++ sell copies of the Software, and to permit persons to whom the Software is ++ furnished to do so, subject to the following conditions: ++ ++ The above copyright notice and this permission notice shall be included in ++ all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS ++ IN THE SOFTWARE. ++*/ ++ ++#ifndef POCL_EXPORT_H ++#define POCL_EXPORT_H ++ ++#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 1) ++#define POCL_EXPORT __attribute__ ((visibility ("default"))) ++#else ++#define POCL_EXPORT ++#endif ++ ++#endif +-- +2.20.1 + diff --git a/patches/0012-add-POCL_EXPORT-decorations.patch b/patches/0012-add-POCL_EXPORT-decorations.patch new file mode 100644 index 0000000..f01b810 --- /dev/null +++ b/patches/0012-add-POCL_EXPORT-decorations.patch @@ -0,0 +1,314 @@ +From fe34534146f49d57f96972b3fba80449d8a5f9f9 Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Fri, 5 Feb 2021 18:06:40 +0100 +Subject: [PATCH 12/13] add POCL_EXPORT decorations + +this is the minimal set needed for building the basic and pthread +devices with -fvisibility=hidden +--- + include/pocl.h | 2 ++ + lib/CL/devices/common.h | 12 ++++++++++++ + lib/CL/devices/cpuinfo.h | 1 + + lib/CL/devices/devices.h | 1 + + lib/CL/devices/pocl_local_size.h | 1 + + lib/CL/devices/prototypes.inc | 1 + + lib/CL/devices/topology/pocl_topology.h | 1 + + lib/CL/pocl_debug.h | 7 +++++++ + lib/CL/pocl_llvm.h | 1 + + lib/CL/pocl_llvm_api.h | 1 + + lib/CL/pocl_runtime_config.h | 4 ++++ + lib/CL/pocl_util.h | 12 ++++++++++++ + 12 files changed, 44 insertions(+) + +diff --git a/include/pocl.h b/include/pocl.h +index 8c4280ef..128ee420 100644 +--- a/include/pocl.h ++++ b/include/pocl.h +@@ -40,6 +40,8 @@ + + #include "config.h" + ++#include "pocl_export.h" ++ + #include "pocl_context.h" + + /* detects restrict, variadic macros etc */ +diff --git a/lib/CL/devices/common.h b/lib/CL/devices/common.h +index 239e69c4..7b2bc0d3 100644 +--- a/lib/CL/devices/common.h ++++ b/lib/CL/devices/common.h +@@ -64,9 +64,11 @@ int llvm_codegen (char *output, unsigned device_i, cl_kernel kernel, + cl_device_id device, _cl_command_node *command, + int specialize); + ++POCL_EXPORT + void pocl_fill_dev_image_t (dev_image_t *di, struct pocl_argument *parg, + cl_device_id device); + ++POCL_EXPORT + void pocl_fill_dev_sampler_t (dev_sampler_t *ds, struct pocl_argument *parg); + + void pocl_copy_mem_object (cl_device_id dest_dev, cl_mem dest, +@@ -79,33 +81,42 @@ void pocl_migrate_mem_objects (_cl_command_node *node); + void pocl_scheduler (_cl_command_node * volatile * ready_list, + pthread_mutex_t *lock_ptr); + ++POCL_EXPORT + void pocl_exec_command (_cl_command_node * volatile node); + ++POCL_EXPORT + void pocl_ndrange_node_cleanup(_cl_command_node *node); + void pocl_mem_objs_cleanup (cl_event event); + ++POCL_EXPORT + void pocl_broadcast (cl_event event); + ++POCL_EXPORT + void pocl_init_dlhandle_cache (); + + char *pocl_check_kernel_disk_cache (_cl_command_node *cmd, int specialized); + + size_t pocl_cmd_max_grid_dim_width (_cl_command_run *cmd); + ++POCL_EXPORT + void pocl_check_kernel_dlhandle_cache (_cl_command_node *command, + unsigned initial_refcount, + int specialize); + ++POCL_EXPORT + void pocl_release_dlhandle_cache (_cl_command_node *cmd); + + void pocl_setup_device_for_system_memory(cl_device_id device); + + void pocl_reinit_system_memory(); + ++POCL_EXPORT + void pocl_set_buffer_image_limits(cl_device_id device); + ++POCL_EXPORT + void* pocl_aligned_malloc_global_mem(cl_device_id device, size_t align, size_t size); + ++POCL_EXPORT + void pocl_free_global_mem(cl_device_id device, void *ptr, size_t size); + + void pocl_print_system_memory_stats(); +@@ -113,6 +124,7 @@ void pocl_print_system_memory_stats(); + void pocl_calculate_kernel_hash (cl_program program, unsigned kernel_i, + unsigned device_i); + ++POCL_EXPORT + void pocl_init_default_device_infos (cl_device_id dev); + + #ifdef __cplusplus +diff --git a/lib/CL/devices/cpuinfo.h b/lib/CL/devices/cpuinfo.h +index 152793d8..a63d5827 100644 +--- a/lib/CL/devices/cpuinfo.h ++++ b/lib/CL/devices/cpuinfo.h +@@ -32,6 +32,7 @@ + + #include "pocl_cl.h" + ++POCL_EXPORT + void pocl_cpuinfo_detect_device_info(cl_device_id device); + + #endif /* POCL_TOPOLOGY_H */ +diff --git a/lib/CL/devices/devices.h b/lib/CL/devices/devices.h +index bbb0a663..e15f3c40 100644 +--- a/lib/CL/devices/devices.h ++++ b/lib/CL/devices/devices.h +@@ -68,6 +68,7 @@ unsigned int pocl_get_devices(cl_device_type device_type, struct _cl_device_id * + * \return If the env var was not set, return -1, if the env var is specified, return 0 + * or the number of occurrence of dev_type in the env var + */ ++POCL_EXPORT + int pocl_device_get_env_count(const char *dev_type); + + /** +diff --git a/lib/CL/devices/pocl_local_size.h b/lib/CL/devices/pocl_local_size.h +index 0fb73167..359a195c 100644 +--- a/lib/CL/devices/pocl_local_size.h ++++ b/lib/CL/devices/pocl_local_size.h +@@ -27,6 +27,7 @@ + #include "pocl_cl.h" + /* The generic local size optimizer used by default, in case there's no target + * specific one defined in the device driver. */ ++POCL_EXPORT + void pocl_default_local_size_optimizer (cl_device_id dev, size_t global_x, + size_t global_y, size_t global_z, + size_t *local_x, size_t *local_y, +diff --git a/lib/CL/devices/prototypes.inc b/lib/CL/devices/prototypes.inc +index 91987eb7..80c584e5 100644 +--- a/lib/CL/devices/prototypes.inc ++++ b/lib/CL/devices/prototypes.inc +@@ -31,6 +31,7 @@ + void pocl_##__DRV__##_wait_event (cl_device_id device, cl_event event); \ + void pocl_##__DRV__##_update_event (cl_device_id device, cl_event event); \ + void pocl_##__DRV__##_free_event_data (cl_event event); \ ++ POCL_EXPORT \ + void pocl_##__DRV__##_init_device_ops (struct pocl_device_ops *ops); \ + cl_int pocl_##__DRV__##_uninit (unsigned j, cl_device_id device); \ + cl_int pocl_##__DRV__##_reinit (unsigned j, cl_device_id device); \ +diff --git a/lib/CL/devices/topology/pocl_topology.h b/lib/CL/devices/topology/pocl_topology.h +index cc390f9f..159ba308 100644 +--- a/lib/CL/devices/topology/pocl_topology.h ++++ b/lib/CL/devices/topology/pocl_topology.h +@@ -33,6 +33,7 @@ + + #include "pocl_cl.h" + ++POCL_EXPORT + int pocl_topology_detect_device_info(cl_device_id device); + + #endif /* POCL_TOPOLOGY_H */ +diff --git a/lib/CL/pocl_debug.h b/lib/CL/pocl_debug.h +index 718cc391..c0d1e635 100644 +--- a/lib/CL/pocl_debug.h ++++ b/lib/CL/pocl_debug.h +@@ -17,6 +17,8 @@ + + #include "config.h" + ++#include "pocl_export.h" ++ + // size_t print spec + #ifndef PRIuS + # define PRIuS "zu" +@@ -105,7 +107,9 @@ extern "C" { + + #ifdef POCL_DEBUG_MESSAGES + ++POCL_EXPORT + extern uint64_t pocl_debug_messages_filter; ++POCL_EXPORT + extern int pocl_stderr_is_a_tty; + + #define POCL_DEBUGGING_ON (pocl_debug_messages_filter) +@@ -118,9 +122,12 @@ extern "C" { + + #define POCL_DEBUG_HEADER(FILTER, FILTER_TYPE) \ + pocl_debug_print_header (__func__, __LINE__, #FILTER, FILTER_TYPE); ++POCL_EXPORT + extern void pocl_debug_output_lock (); ++POCL_EXPORT + extern void pocl_debug_output_unlock (); + extern void pocl_debug_messages_setup (const char *debug); ++POCL_EXPORT + extern void pocl_debug_print_header (const char * func, unsigned line, + const char* filter, int filter_type); + extern void pocl_debug_measure_start (uint64_t* start); +diff --git a/lib/CL/pocl_llvm.h b/lib/CL/pocl_llvm.h +index bd1d47ff..960aca6d 100644 +--- a/lib/CL/pocl_llvm.h ++++ b/lib/CL/pocl_llvm.h +@@ -30,6 +30,7 @@ extern "C" { + #endif + + /* Returns the cpu name as reported by LLVM. */ ++POCL_EXPORT + char *get_llvm_cpu_name (); + /* Returns if the cpu supports FMA instruction (uses LLVM). */ + int cpu_has_fma(); +diff --git a/lib/CL/pocl_llvm_api.h b/lib/CL/pocl_llvm_api.h +index d3bf44e9..b33241a2 100644 +--- a/lib/CL/pocl_llvm_api.h ++++ b/lib/CL/pocl_llvm_api.h +@@ -65,6 +65,7 @@ public: + }; + + ++POCL_EXPORT + extern cl_device_id currentPoclDevice; + + void InitializeLLVM(); +diff --git a/lib/CL/pocl_runtime_config.h b/lib/CL/pocl_runtime_config.h +index eb54dd94..7f47c13f 100644 +--- a/lib/CL/pocl_runtime_config.h ++++ b/lib/CL/pocl_runtime_config.h +@@ -25,12 +25,16 @@ + #ifndef _POCL_RUNTIME_CONFIG_H + #define _POCL_RUNTIME_CONFIG_H + ++#include "pocl_export.h" ++ + #ifdef __cplusplus + extern "C" { + #endif + + int pocl_is_option_set(const char *key); ++POCL_EXPORT + int pocl_get_int_option(const char *key, int default_value); ++POCL_EXPORT + int pocl_get_bool_option(const char *key, int default_value); + const char* pocl_get_string_option(const char *key, const char *default_value); + +diff --git a/lib/CL/pocl_util.h b/lib/CL/pocl_util.h +index ce104602..c35c9086 100644 +--- a/lib/CL/pocl_util.h ++++ b/lib/CL/pocl_util.h +@@ -57,17 +57,23 @@ uint32_t byteswap_uint32_t (uint32_t word, char should_swap); + float byteswap_float (float word, char should_swap); + + /* set rounding mode */ ++POCL_EXPORT + void pocl_restore_rm (unsigned rm); + /* get current rounding mode */ ++POCL_EXPORT + unsigned pocl_save_rm (); + /* set OpenCL's default (round to nearest) rounding mode */ ++POCL_EXPORT + void pocl_set_default_rm (); + + /* sets the flush-denorms-to-zero flag on the CPU, if supported */ ++POCL_EXPORT + void pocl_set_ftz (unsigned ftz); + + /* saves / restores cpu flags*/ ++POCL_EXPORT + unsigned pocl_save_ftz (); ++POCL_EXPORT + void pocl_restore_ftz (unsigned ftz); + + /* Finds the next highest power of two of the given value. */ +@@ -83,6 +89,7 @@ uint64_t pocl_size_ceil2_64 (uint64_t x); + * must be a non-zero power of 2. + */ + ++POCL_EXPORT + void *pocl_aligned_malloc(size_t alignment, size_t size); + #define pocl_aligned_free(x) POCL_MEM_FREE(x) + +@@ -131,6 +138,7 @@ check_copy_overlap(const size_t src_offset[3], + * Push a command into ready list if all previous events are completed or + * in pending_list if the command still has pending dependencies + */ ++POCL_EXPORT + void + pocl_command_push (_cl_command_node *node, + _cl_command_node * volatile * ready_list, +@@ -182,12 +190,15 @@ void pocl_abort_on_pthread_error (int status, unsigned line, const char *func); + + void pocl_update_event_queued (cl_event event); + ++POCL_EXPORT + void pocl_update_event_submitted (cl_event event); + + void pocl_update_event_running_unlocked (cl_event event); + ++POCL_EXPORT + void pocl_update_event_running (cl_event event); + ++POCL_EXPORT + void pocl_update_event_complete_msg (const char *func, unsigned line, + cl_event event, const char *msg); + +@@ -197,6 +208,7 @@ void pocl_update_event_complete_msg (const char *func, unsigned line, + #define POCL_UPDATE_EVENT_COMPLETE(__event) \ + pocl_update_event_complete_msg (__func__, __LINE__, (__event), NULL); + ++POCL_EXPORT + void pocl_update_event_failed (cl_event event); + + const char* +-- +2.20.1 + diff --git a/patches/0013-add-VISIBILITY_HIDDEN-cmake-option.patch b/patches/0013-add-VISIBILITY_HIDDEN-cmake-option.patch new file mode 100644 index 0000000..d91e729 --- /dev/null +++ b/patches/0013-add-VISIBILITY_HIDDEN-cmake-option.patch @@ -0,0 +1,30 @@ +From a2d016c84d2034f43062d7f22b4874cfffe5c127 Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Fri, 5 Feb 2021 18:08:16 +0100 +Subject: [PATCH 13/13] add VISIBILITY_HIDDEN cmake option + +to allow building with -fvisibility=hidden -fvisibility-inlines-hidden +--- + CMakeLists.txt | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6817dc00..83c030cd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -179,6 +179,12 @@ option(POCL_ICD_ABSOLUTE_PATH "Use absolute path in pocl.icd" ON) + + option(ENABLE_POCL_BUILDING "When OFF, env var POCL_BUILDING has no effect. Defaults to ON" ON) + ++option(VISIBILITY_HIDDEN "Build with -fvisibility=hidden -fvisibility-inlines-hidden" OFF) ++if(VISIBILITY_HIDDEN) ++ add_compile_options(-fvisibility=hidden) ++ add_compile_options($<$:-fvisibility-inlines-hidden>) ++endif() ++ + #### these are mostly useful for pocl developers + + option(DEVELOPER_MODE "This will SIGNIFICANTLY slow down pocl (but speed up its compilation). Only turn on if you know what you're doing." OFF) +-- +2.20.1 + diff --git a/patches/1001-stop-building-libllvmopencl.so-which-is-no-longer-us.patch b/patches/1001-stop-building-libllvmopencl.so-which-is-no-longer-us.patch new file mode 100644 index 0000000..7e422fe --- /dev/null +++ b/patches/1001-stop-building-libllvmopencl.so-which-is-no-longer-us.patch @@ -0,0 +1,71 @@ +From 1415ced8fb837d91e3a695597467af106e6a99f9 Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Sat, 13 Feb 2021 22:51:43 +0100 +Subject: [PATCH] stop building libllvmopencl.so which is no longer used since + 0.14 + +--- + CMakeLists.txt | 2 +- + lib/llvmopencl/CMakeLists.txt | 36 ----------------------------------- + 2 files changed, 1 insertion(+), 37 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 87f10c62..7e90adf6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -321,7 +321,7 @@ endif() + # for libpocl.so + set(POCL_INSTALL_PUBLIC_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" CACHE PATH "POCL public libdir") + +-# for llvmopencl.so ++# for libpocl-devices-*.so + set(POCL_INSTALL_PRIVATE_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pocl" CACHE PATH "POCL private libdir") + + # for pocl.icd +diff --git a/lib/llvmopencl/CMakeLists.txt b/lib/llvmopencl/CMakeLists.txt +index e2a546d4..b0a1e562 100644 +--- a/lib/llvmopencl/CMakeLists.txt ++++ b/lib/llvmopencl/CMakeLists.txt +@@ -100,39 +100,3 @@ endif(MSVC) + #noinst_LTLIBRARIES = libllvmpasses.la + add_library("llvmpasses" OBJECT ${LLVMPASSES_SOURCES}) + harden("llvmpasses") +- +-# This creates a separate llvmopencl.so that is loaded to 'opt' +-# for the pocl-workgroup version. +-#pkglib_LTLIBRARIES = llvmopencl.la +-add_library("llvmopencl" MODULE "$") +-harden("llvmopencl") +- +-# not sure where other platforms get their library linkage list, probably there is +-# way to make this more consistent on different platforms +-if(MSVC) +- target_link_libraries("llvmopencl" ${POCL_LLVM_LIBS}) +-endif(MSVC) +- +-#target_link_libraries("llvmopencl" "${LLVM_SYSLIBS}") +- +-# TODO cmake should handle this, i might me missing something … +-if(APPLE) +- set(ADD_LD_FLAGS "-Wl,-undefined -Wl,dynamic_lookup ") +-else() +- set(ADD_LD_FLAGS "-Wl,-export-dynamic") +-endif() +- +-# TODO ENABLE_EXPORTS -> Wl,export_dynamic +-# http://www.cmake.org/cmake/help/v2.8.12/cmake.html#prop_tgt:ENABLE_EXPORTS +-# http://www.cmake.org/pipermail/cmake/2011-November/047708.html +-set_target_properties("llvmopencl" PROPERTIES LINK_FLAGS "${LLVM_LDFLAGS} ${ADD_LD_FLAGS}") +-if(NOT APPLE) +- set_target_properties("llvmopencl" PROPERTIES SOVERSION "${KERNEL_COMPILER_LIB_VERSION}" VERSION "${KERNEL_COMPILER_LIB_VERSION}") +-endif() +- +-install(TARGETS "llvmopencl" +- LIBRARY DESTINATION ${POCL_INSTALL_PRIVATE_LIBDIR} +- COMPONENT "lib" +- ARCHIVE DESTINATION ${POCL_INSTALL_PRIVATE_LIBDIR}/static +- COMPONENT "dev" +-) +-- +2.20.1 + diff --git a/patches/1014-add-POCL_EXPORT-to-additional-symbols-needed-by-the-.patch b/patches/1014-add-POCL_EXPORT-to-additional-symbols-needed-by-the-.patch new file mode 100644 index 0000000..fa47f12 --- /dev/null +++ b/patches/1014-add-POCL_EXPORT-to-additional-symbols-needed-by-the-.patch @@ -0,0 +1,127 @@ +From 4394c02df75215255f856fb08baaa669b1eee4ed Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Wed, 10 Feb 2021 23:25:57 +0100 +Subject: [PATCH 14/14] add POCL_EXPORT to additional symbols needed by the + cuda device + +--- + include/pocl_cache.h | 1 + + include/pocl_file_util.h | 2 ++ + lib/CL/pocl_intfn.h | 2 ++ + lib/CL/pocl_llvm.h | 1 + + lib/CL/pocl_runtime_config.h | 1 + + lib/CL/pocl_timing.h | 3 +++ + lib/CL/pocl_util.h | 1 + + 7 files changed, 11 insertions(+) + +diff --git a/include/pocl_cache.h b/include/pocl_cache.h +index 377aa21a..a4add4c9 100644 +--- a/include/pocl_cache.h ++++ b/include/pocl_cache.h +@@ -110,6 +110,7 @@ void pocl_cache_program_bc_path(char* program_bc_path, + cl_program program, + unsigned device_i); + ++POCL_EXPORT + void pocl_cache_work_group_function_path (char *parallel_bc_path, + cl_program program, + unsigned device_i, cl_kernel kernel, +diff --git a/include/pocl_file_util.h b/include/pocl_file_util.h +index a6d73f0a..914ad9bf 100644 +--- a/include/pocl_file_util.h ++++ b/include/pocl_file_util.h +@@ -42,6 +42,7 @@ int pocl_remove(const char* path); + + int pocl_rename(const char *oldpath, const char *newpath); + ++POCL_EXPORT + int pocl_exists(const char* path); + + /* Touch file to change last modified time. For portability, this +@@ -49,6 +50,7 @@ int pocl_exists(const char* path); + int pocl_touch_file(const char* path); + + /* Writes or appends data to a file. */ ++POCL_EXPORT + int pocl_write_file(const char* path, const char* content, + uint64_t count, int append, int dont_rewrite); + +diff --git a/lib/CL/pocl_intfn.h b/lib/CL/pocl_intfn.h +index 84879f8e..2a72118c 100644 +--- a/lib/CL/pocl_intfn.h ++++ b/lib/CL/pocl_intfn.h +@@ -99,6 +99,7 @@ POdeclsymICD(clIcdGetPlatformIDsKHR) + POdeclsym(clReleaseCommandQueue) + POdeclsym(clReleaseContext) + POdeclsym(clReleaseDevice) ++POCL_EXPORT + POdeclsym(clReleaseEvent) + POdeclsym(clReleaseKernel) + POdeclsym(clReleaseMemObject) +@@ -107,6 +108,7 @@ POdeclsym(clReleaseSampler) + POdeclsym(clRetainCommandQueue) + POdeclsym(clRetainContext) + POdeclsym(clRetainDevice) ++POCL_EXPORT + POdeclsym(clRetainEvent) + POdeclsym(clRetainKernel) + POdeclsym(clRetainMemObject) +diff --git a/lib/CL/pocl_llvm.h b/lib/CL/pocl_llvm.h +index 960aca6d..6c9a4ac5 100644 +--- a/lib/CL/pocl_llvm.h ++++ b/lib/CL/pocl_llvm.h +@@ -68,6 +68,7 @@ int pocl_llvm_get_kernels_metadata(cl_program program, unsigned device_i); + * WG function that might be specialized according to the properties of + * the given Command. + */ ++POCL_EXPORT + int pocl_llvm_generate_workgroup_function (unsigned DeviceI, + cl_device_id Device, + cl_kernel Kernel, +diff --git a/lib/CL/pocl_runtime_config.h b/lib/CL/pocl_runtime_config.h +index 7f47c13f..4f300f1d 100644 +--- a/lib/CL/pocl_runtime_config.h ++++ b/lib/CL/pocl_runtime_config.h +@@ -36,6 +36,7 @@ POCL_EXPORT + int pocl_get_int_option(const char *key, int default_value); + POCL_EXPORT + int pocl_get_bool_option(const char *key, int default_value); ++POCL_EXPORT + const char* pocl_get_string_option(const char *key, const char *default_value); + + #ifdef __cplusplus +diff --git a/lib/CL/pocl_timing.h b/lib/CL/pocl_timing.h +index afcffd94..7d27b9b1 100644 +--- a/lib/CL/pocl_timing.h ++++ b/lib/CL/pocl_timing.h +@@ -26,12 +26,15 @@ + + #include "config.h" + ++#include "pocl_export.h" ++ + #ifdef __cplusplus + extern "C" { + #endif + + extern const unsigned pocl_timer_resolution; + ++POCL_EXPORT + uint64_t pocl_gettimemono_ns(); + + int pocl_gettimereal(int *year, int *mon, int *day, int *hour, int *min, int *sec, int* nanosec); +diff --git a/lib/CL/pocl_util.h b/lib/CL/pocl_util.h +index c35c9086..3789ca1d 100644 +--- a/lib/CL/pocl_util.h ++++ b/lib/CL/pocl_util.h +@@ -214,6 +214,7 @@ void pocl_update_event_failed (cl_event event); + const char* + pocl_status_to_str (int status); + ++POCL_EXPORT + const char * + pocl_command_to_str (cl_command_type cmd); + +-- +2.20.1 + diff --git a/patches/2001-add-testcase-for-Debian-bug-975931.patch b/patches/2001-add-testcase-for-Debian-bug-975931.patch new file mode 100644 index 0000000..f0b3377 --- /dev/null +++ b/patches/2001-add-testcase-for-Debian-bug-975931.patch @@ -0,0 +1,214 @@ +From b46f2a3aef3aad6290758af0141516c3dc2aa4f8 Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Thu, 10 Dec 2020 19:47:30 +0100 +Subject: [PATCH] add testcase for Debian bug #975931 + +--- + tests/regression/CMakeLists.txt | 3 + + .../test_llvm_segfault_debian_bug_975931.cpp | 173 ++++++++++++++++++ + 2 files changed, 176 insertions(+) + create mode 100644 tests/regression/test_llvm_segfault_debian_bug_975931.cpp + +diff --git a/tests/regression/CMakeLists.txt b/tests/regression/CMakeLists.txt +index a5ee9159..c14044af 100644 +--- a/tests/regression/CMakeLists.txt ++++ b/tests/regression/CMakeLists.txt +@@ -40,6 +40,7 @@ set(PROGRAMS_TO_BUILD test_barrier_between_for_loops test_early_return + test_for_with_var_iteration_count test_id_dependent_computation + test_locals test_loop_phi_replication test_multi_level_loops_with_barriers + test_simple_for_with_a_barrier test_structs_as_args test_vectors_as_args ++ test_llvm_segfault_debian_bug_975931 + test_barrier_before_return test_infinite_loop test_constant_array + test_undominated_variable test_setargs test_null_arg + test_fors_with_var_iteration_counts test_issue_231 test_issue_445 +@@ -76,6 +77,8 @@ add_test_pocl(NAME "regression/test_issue_757" COMMAND "test_issue_757") + + add_test_pocl(NAME "regression/test_flatten_barrier_subs" COMMAND "test_flatten_barrier_subs" EXPECTED_OUTPUT "test_flatten_barrier_subs.output") + ++add_test_pocl(NAME "regression/test_llvm_segfault_debian_bug_975931" COMMAND "test_llvm_segfault_debian_bug_975931") ++ + # repl + + add_test_pocl(NAME "regression/phi_nodes_not_replicated_REPL" COMMAND "test_loop_phi_replication") +diff --git a/tests/regression/test_llvm_segfault_debian_bug_975931.cpp b/tests/regression/test_llvm_segfault_debian_bug_975931.cpp +new file mode 100644 +index 00000000..220fe628 +--- /dev/null ++++ b/tests/regression/test_llvm_segfault_debian_bug_975931.cpp +@@ -0,0 +1,173 @@ ++/* ++ ++ Copyright (c) 2013 Pekka Jääskeläinen and ++ Kalray ++ ++ Permission is hereby granted, free of charge, to any person obtaining a copy ++ of this software and associated documentation files (the "Software"), to deal ++ in the Software without restriction, including without limitation the rights ++ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ++ copies of the Software, and to permit persons to whom the Software is ++ furnished to do so, subject to the following conditions: ++ ++ The above copyright notice and this permission notice shall be included in ++ all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ++ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ++ THE SOFTWARE. ++*/ ++ ++#include ++#include ++#include ++#include ++#include ++#include "config.h" ++ ++const char source[] = ++"#ifdef DOUBLE_PRECISION\n" ++" #ifdef cl_khr_fp64\n" ++" #pragma OPENCL EXTENSION cl_khr_fp64 : enable\n" ++" #else\n" ++" #pragma OPENCL EXTENSION cl_amd_fp64 : enable\n" ++" #endif\n" ++"#endif\n" ++"\n" ++"__kernel void Sdot_kernel( __global float *_X, __global float *_Y, __global float *scratchBuff,\n" ++" uint N, uint offx, int incx, uint offy, int incy, int doConj )\n" ++"{\n" ++" __global float *X = _X + offx;\n" ++" __global float *Y = _Y + offy;\n" ++" float dotP = (float) 0.0;\n" ++"\n" ++" if ( incx < 0 ) {\n" ++" X = X + (N - 1) * abs(incx);\n" ++" }\n" ++" if ( incy < 0 ) {\n" ++" Y = Y + (N - 1) * abs(incy);\n" ++" }\n" ++"\n" ++" int gOffset;\n" ++" for( gOffset=(get_global_id(0) * 4); (gOffset + 4 - 1) 0); ++ ++ CHECK_CL_ERROR(clGetDeviceIDs(platforms[0], CL_DEVICE_TYPE_ALL, MAX_DEVICES, devices, &ndevices)); ++ TEST_ASSERT(ndevices > 0); ++ ++ cl_context context = clCreateContext(NULL, 1, devices, NULL, NULL, &err); ++ CHECK_OPENCL_ERROR_IN("clCreateContext"); ++ ++ const char * src[] = {source}; ++ program = clCreateProgramWithSource(context, 1, src, NULL, &err); ++ CHECK_OPENCL_ERROR_IN("clCreateProgramWithSource"); ++ ++ CHECK_CL_ERROR(clBuildProgram(program, 1, devices, "-g -DINCX_NONUNITY -DINCY_NONUNITY", NULL, NULL)); ++ ++ CHECK_CL_ERROR(clGetProgramInfo(program, CL_PROGRAM_BINARY_SIZES, sizeof(binsizes), binsizes, &nbinaries)); ++ printf("binary size: %zd\n", binsizes[0]); ++ ++ CHECK_CL_ERROR(clReleaseProgram(program)); ++ ++ CHECK_CL_ERROR (clReleaseContext (context)); ++ ++ printf ("OK\n"); ++ ++ return EXIT_SUCCESS; ++} +-- +2.20.1 + diff --git a/patches/2003-restore-setting-unroll-threshold-on-LLVM-9.patch b/patches/2003-restore-setting-unroll-threshold-on-LLVM-9.patch new file mode 100644 index 0000000..bdbd3d4 --- /dev/null +++ b/patches/2003-restore-setting-unroll-threshold-on-LLVM-9.patch @@ -0,0 +1,32 @@ +From d787e3dc51adadf6b6efbf04a2b2e3193ef9b477 Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann +Date: Wed, 27 Jan 2021 21:26:51 +0100 +Subject: [PATCH] restore setting unroll-threshold on LLVM 9 + +otherwise kernel/test_rotate hangs on avx512 capable cpus + +(this partially reverts 459d0bb5241a62af3b5b607a65dcf5e9a34a01ee) +--- + lib/CL/pocl_llvm_utils.cc | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/lib/CL/pocl_llvm_utils.cc b/lib/CL/pocl_llvm_utils.cc +index aa0d33dd..7ff66450 100644 +--- a/lib/CL/pocl_llvm_utils.cc ++++ b/lib/CL/pocl_llvm_utils.cc +@@ -347,6 +347,12 @@ void InitializeLLVM() { + O->addOccurrence(1, StringRef("debug"), StringRef("true"), false); + } + ++#if LLVM_MAJOR == 9 ++ O = opts["unroll-threshold"]; ++ assert(O && "could not find LLVM option 'unroll-threshold'"); ++ O->addOccurrence(1, StringRef("unroll-threshold"), StringRef("1"), false); ++#endif ++ + LLVMInitialized = true; + } + +-- +2.20.1 + diff --git a/patches/distro.patch b/patches/distro.patch new file mode 100644 index 0000000..0d0e5b4 --- /dev/null +++ b/patches/distro.patch @@ -0,0 +1,39 @@ +Author: Andreas Beckmann +Description: tune distro mode +Forwarded: no-needed + +--- a/lib/kernel/host/CMakeLists.txt ++++ b/lib/kernel/host/CMakeLists.txt +@@ -317,8 +317,8 @@ separate_arguments(DEVICE_C_FLAGS) + function(x86_distro_variant_to_flags VARIANT OUT_LLC_FLAGS OUT_CLANG_FLAGS) + + if("${VARIANT}" STREQUAL "sse2") +- set(CLANG_F "${CLANG_MARCH_FLAG}athlon64") +- set(LLC_F "-mcpu=athlon64") ++ set(CLANG_F "${CLANG_MARCH_FLAG}x86-64") ++ set(LLC_F "-mcpu=x86-64") + + elseif("${VARIANT}" STREQUAL "ssse3") + set(CLANG_F "${CLANG_MARCH_FLAG}core2") +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1041,6 +1041,9 @@ endif() + + set(KERNELLIB_HOST_DISTRO_VARIANTS 0) + if(KERNELLIB_HOST_CPU_VARIANTS STREQUAL "distro") ++ if("${LLC_HOST_CPU}" STREQUAL "GENERIC") ++ set(HOST_CPU_FORCED 0 CACHE INTERNAL "CPU is forced by user") ++ endif() + if(HOST_CPU_FORCED) + message(FATAL_ERROR "Cannot build with CPU autodetection distro variants build, and enforce LLC_HOST_CPU at the same time. Please pick one") + endif() +@@ -1051,6 +1054,9 @@ if(KERNELLIB_HOST_CPU_VARIANTS STREQUAL + else() + message(FATAL_ERROR "Don't know what CPU variants to use for kernel library on this platform.") + endif() ++ if("${LLC_HOST_CPU}" STREQUAL "GENERIC") ++ list(INSERT KERNELLIB_HOST_CPU_VARIANTS 0 ${LLC_HOST_CPU}) ++ endif() + set(KERNELLIB_HOST_DISTRO_VARIANTS 1) + endif() + diff --git a/patches/generic-cpu.patch b/patches/generic-cpu.patch new file mode 100644 index 0000000..21f085d --- /dev/null +++ b/patches/generic-cpu.patch @@ -0,0 +1,71 @@ +Author: Andreas Beckmann +Description: add support for a GENERIC cpu type that uses llvm defaults +Forwarded: not-needed + +--- a/lib/kernel/host/CMakeLists.txt ++++ b/lib/kernel/host/CMakeLists.txt +@@ -472,6 +472,11 @@ else() + set(LLC_CPUFLAGS "-mcpu=${VARIANT}") + endif() + ++if("${VARIANT}" STREQUAL "GENERIC") ++ set(CLANG_CPUFLAGS "") ++ set(LLC_CPUFLAGS "") ++endif() ++ + separate_arguments(CLANG_CPUFLAGS) + separate_arguments(LLC_CPUFLAGS) + set(CLANG_FLAGS ${HOST_CLANG_FLAGS} ${CLANG_CPUFLAGS} +--- a/lib/CL/devices/common.c ++++ b/lib/CL/devices/common.c +@@ -1572,6 +1572,9 @@ pocl_init_default_device_infos (cl_devic + dev->llvm_cpu = get_llvm_cpu_name (); + #endif + ++ if(dev->llvm_cpu && (!strcmp(dev->llvm_cpu, "GENERIC"))) ++ dev->llvm_cpu = NULL; ++ + dev->spirv_version = "SPIR-V_1.2"; + #else /* No compiler, no CPU info */ + dev->llvm_cpu = NULL; +--- a/lib/CL/pocl_llvm_build.cc ++++ b/lib/CL/pocl_llvm_build.cc +@@ -879,7 +879,7 @@ static llvm::Module* getKernelLibrary(cl + kernellib_fallback = kernellib; + kernellib_fallback += OCL_KERNEL_TARGET_CPU; + kernellib_fallback += ".bc"; +- kernellib += device->llvm_cpu; ++ kernellib += device->llvm_cpu ? device->llvm_cpu : "GENERIC"; + #endif + } + kernellib += ".bc"; +--- a/cmake/LLVM.cmake ++++ b/cmake/LLVM.cmake +@@ -720,17 +720,25 @@ endif() + + if(NOT DEFINED CLANG_MARCH_FLAG) + message(STATUS "Checking clang -march vs. -mcpu flag") +- custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -march=${LLC_HOST_CPU}) ++ if(LLC_HOST_CPU STREQUAL "GENERIC" AND NOT KERNELLIB_HOST_CPU_VARIANTS STREQUAL "distro") ++ set(CLANG_MARCH_FLAG "-None=") ++ else() ++ set(LLC_HOST_CPU_TEST "${LLC_HOST_CPU}") ++ if(LLC_HOST_CPU STREQUAL "GENERIC") ++ set(LLC_HOST_CPU_TEST "${LLC_HOST_CPU_AUTO}") ++ endif() ++ custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -march=${LLC_HOST_CPU_TEST}) + if(NOT RES) + set(CLANG_MARCH_FLAG "-march=") + else() +- custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -mcpu=${LLC_HOST_CPU}) ++ custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -mcpu=${LLC_HOST_CPU_TEST}) + if(NOT RES) + set(CLANG_MARCH_FLAG "-mcpu=") + else() + message(FATAL_ERROR "Could not determine whether to use -march or -mcpu with clang") + endif() + endif() ++ endif() + message(STATUS " Using ${CLANG_MARCH_FLAG}") + + set(CLANG_MARCH_FLAG ${CLANG_MARCH_FLAG} CACHE INTERNAL "Clang option used to specify the target cpu") diff --git a/patches/series b/patches/series new file mode 100644 index 0000000..0d910d8 --- /dev/null +++ b/patches/series @@ -0,0 +1,25 @@ +0001-fix-build-on-hurd-i386.patch +0002-link-against-single-shared-libclang-cpp-when-buildin.patch +0003-rename-stderr_is_a_tty-to-pocl_stderr_is_a_tty.patch +0004-rename-fill_dev_-_t-to-pocl_fill_dev_-_t.patch +0005-handle-dlsym-error-on-device-library.patch +0006-check-whether-libpocl-and-the-device-libraries-can-b.patch +0007-drop-redundant-include.patch +0008-drop-unused-global-variable-pocl_num_device_types.patch +0009-regroup-workgroup-tests-and-add-missing-dependencies.patch +0010-minor-cleanup.patch +0011-add-include-pocl_export.h-for-new-macro-POCL_EXPORT.patch +0012-add-POCL_EXPORT-decorations.patch +0013-add-VISIBILITY_HIDDEN-cmake-option.patch +1014-add-POCL_EXPORT-to-additional-symbols-needed-by-the-.patch +skip-subdevice-tests-on-single-core-cpus.patch +test_printf.patch +test_structs_as_args.patch +generic-cpu.patch +distro.patch +verbose.patch +2001-add-testcase-for-Debian-bug-975931.patch +2003-restore-setting-unroll-threshold-on-LLVM-9.patch +timeout.patch +use-system-CL-headers.patch +1001-stop-building-libllvmopencl.so-which-is-no-longer-us.patch diff --git a/patches/skip-subdevice-tests-on-single-core-cpus.patch b/patches/skip-subdevice-tests-on-single-core-cpus.patch new file mode 100644 index 0000000..e068291 --- /dev/null +++ b/patches/skip-subdevice-tests-on-single-core-cpus.patch @@ -0,0 +1,64 @@ +Author: Andreas Beckmann +Description: skip subdevice tests on (virtual) single core CPUs + +--- a/examples/EinsteinToolkit/CMakeLists.txt ++++ b/examples/EinsteinToolkit/CMakeLists.txt +@@ -54,5 +54,6 @@ if(NOT MIPS) + COST 15.0 + LABELS "EinsteinToolkit" + ENVIRONMENT "POCL_AFFINITY=1" ++ SKIP_RETURN_CODE 77 + DEPENDS "pocl_version_check") + endif() +--- a/examples/EinsteinToolkit/EinsteinToolkit.c ++++ b/examples/EinsteinToolkit/EinsteinToolkit.c +@@ -528,6 +528,16 @@ void setup(const char* program_source1, + + if (use_subdev) + { ++ { ++ cl_uint max_cus; ++ int err = clGetDeviceInfo (main_device_id, CL_DEVICE_MAX_COMPUTE_UNITS, ++ sizeof(max_cus), &max_cus, NULL); ++ assert (err == CL_SUCCESS); ++ if (max_cus < 2) { ++ fprintf(stderr, "Insufficient compute units for subdevice creation\n"); ++ exit(77); ++ } ++ } + const cl_device_partition_property props[] + = { CL_DEVICE_PARTITION_EQUALLY, 2, 0 }; + cl_device_id subdevs[128]; +--- a/tests/runtime/CMakeLists.txt ++++ b/tests/runtime/CMakeLists.txt +@@ -87,7 +87,7 @@ add_test_pocl(NAME "runtime/clGetSupport + + add_test_pocl(NAME "runtime/clCreateKernelsInProgram" COMMAND "test_clCreateKernelsInProgram") + +-add_test_pocl(NAME "runtime/clCreateSubDevices" COMMAND "test_clCreateSubDevices") ++add_test(NAME "runtime/clCreateSubDevices" COMMAND "test_clCreateSubDevices") + + add_test_pocl(NAME "runtime/test_event_free" COMMAND "test_event_free") + +@@ -116,6 +116,10 @@ set_tests_properties( "runtime/clGetDevi + DEPENDS "pocl_version_check" + LABELS "internal;runtime") + ++set_tests_properties("runtime/clCreateSubDevices" ++ PROPERTIES ++ SKIP_RETURN_CODE 77) ++ + if(NOT ENABLE_ANYSAN) + set_tests_properties("runtime/clCreateKernelsInProgram" + PROPERTIES +--- a/tests/runtime/test_clCreateSubDevices.c ++++ b/tests/runtime/test_clCreateSubDevices.c +@@ -140,7 +140,7 @@ int main(int argc, char **argv) + { + printf("This test requires a cl device with at least 2 compute units" + " (a dual-core or better CPU)\n"); +- return 1; ++ return 77; + } + + err = clGetDeviceInfo(rootdev, CL_DEVICE_PARTITION_MAX_SUB_DEVICES, diff --git a/patches/test_printf.patch b/patches/test_printf.patch new file mode 100644 index 0000000..da212ac --- /dev/null +++ b/patches/test_printf.patch @@ -0,0 +1,40 @@ +Author: Andreas Beckmann +Description: HACK! kernel/test_printf fails on i686 + #--- tests/kernel/test_printf_expout.txt + #+++ /tmp/cmake_testrun_tkeWb + @@ -145,10 +145,16 @@ + 0x1.4p+3,0x1.15p-141,0x1.52d02cp+78,0x0p+0 + 0x1.68p+6,0x1.2p+3,0x1.ccccccp-1,0x1.70a3d8p-4 + 0x1p+12,0x1p+0,0x1p-3,0x1p-7 + -0xfa,0xfb + -0x1234,0x8765 + +0xfa,0 + +0x1234,0 + 0x12345678,0x87654321 + |a| b|c | + |aa| bb|cc |dddddddddd|eeee| + |0x2349aacc| 0xdeaddeed|0x92820384 | + + + +PARAMETER PASSING + + + +* 0xfa,0 0xfb,0 ü + +* 0x1234,0 0x8765,0 ï + +* 0x12345678,0x87654321 0x2468ace0,0xfdb97531 . + OK +Bug: https://github.com/pocl/pocl/issues/682 +Forwarded: not-needed + +--- a/tests/kernel/CMakeLists.txt ++++ b/tests/kernel/CMakeLists.txt +@@ -222,6 +222,11 @@ add_test_pocl(NAME "kernel/test_printf" + EXPECTED_OUTPUT "test_printf_expout.txt" + COMMAND "kernel" "test_printf") + ++if(LLC_HOST_CPU STREQUAL "i686") ++ set_tests_properties("kernel/test_printf" ++ PROPERTIES WILL_FAIL 1) ++endif() ++ + add_test_pocl(NAME "kernel/test_sizeof_uint" + EXPECTED_OUTPUT "test_sizeof_expout.txt" + COMMAND "kernel" "test_sizeof") diff --git a/patches/test_structs_as_args.patch b/patches/test_structs_as_args.patch new file mode 100644 index 0000000..53b31d9 --- /dev/null +++ b/patches/test_structs_as_args.patch @@ -0,0 +1,33 @@ +Author: Andreas Beckmann +Description: HACK! regression/struct_kernel_arguments fails on i686 + 141/143 Test #85: regression/struct_kernel_arguments ..................................................***Failed Error regular expression found in output. Regex=[FAIL] 4.58 sec + CMake Error at /build/pocl-1.4/cmake/run_test.cmake:34 (message): + FAIL: Test exited with nonzero code (1): + /build/pocl-1.4/obj-i686-linux-gnu/tests/regression/test_structs_as_args + + STDOUT: + + F(4: 0 != 5) F(5: -2147483648 != 6) F(6: 0 != 7) F(7: 0 != 8) + + STDERR: + + + + -- OK +Bug: https://github.com/pocl/pocl/issues/801 +Forwarded: not-needed + +--- a/tests/regression/CMakeLists.txt ++++ b/tests/regression/CMakeLists.txt +@@ -249,6 +249,11 @@ add_test_pocl(NAME "regression/autolocal + + add_test_pocl(NAME "regression/struct_kernel_arguments" COMMAND "test_structs_as_args") + ++if(LLC_HOST_CPU STREQUAL "i686") ++ set_tests_properties("regression/struct_kernel_arguments" ++ PROPERTIES WILL_FAIL 1) ++endif() ++ + add_test_pocl(NAME "regression/vector_kernel_arguments" COMMAND "test_vectors_as_args") + + set(TCE_TESTS "regression/barrier_between_two_for_loops_LOOPS" diff --git a/patches/timeout.patch b/patches/timeout.patch new file mode 100644 index 0000000..dedc879 --- /dev/null +++ b/patches/timeout.patch @@ -0,0 +1,14 @@ +Author: Andreas Beckmann +Description: kill hanging tests after 30 minutes + +--- a/cmake/run_test.cmake ++++ b/cmake/run_test.cmake +@@ -12,7 +12,7 @@ endif() + string(REPLACE "####" ";" test_cmd_separated "${test_cmd}") + + execute_process( +- COMMAND ${test_cmd_separated} ++ COMMAND timeout -k 60 1800 ${test_cmd_separated} + RESULT_VARIABLE test_not_successful + OUTPUT_VARIABLE stdout + ERROR_VARIABLE stderr diff --git a/patches/use-system-CL-headers.patch b/patches/use-system-CL-headers.patch new file mode 100644 index 0000000..cd4b4c3 --- /dev/null +++ b/patches/use-system-CL-headers.patch @@ -0,0 +1,15 @@ +Author: Andreas Beckmann +Description: we move the embedded copy aside to use system CL headers +Forwarded: no-needed + +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -23,7 +23,7 @@ + # + #============================================================================= + +-add_subdirectory("CL") ++#add_subdirectory("CL") + + set(PRIVATE_HEADERS _enable_all_exts.h _builtin_renames.h + _kernel.h _clang_opencl.h diff --git a/patches/verbose.patch b/patches/verbose.patch new file mode 100644 index 0000000..80c6af0 --- /dev/null +++ b/patches/verbose.patch @@ -0,0 +1,17 @@ +Author: Andreas Beckmann +Description: dump some cmake information +Forwarded: not-needed + +--- a/cmake/LLVM.cmake ++++ b/cmake/LLVM.cmake +@@ -24,6 +24,10 @@ + # + #============================================================================= + ++MESSAGE(STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}") ++MESSAGE(STATUS "CMAKE_HOST_SYSTEM_PROCESSOR: ${CMAKE_HOST_SYSTEM_PROCESSOR}") ++MESSAGE(STATUS "CMAKE_LIBRARY_ARCHITECTURE: ${CMAKE_LIBRARY_ARCHITECTURE}") ++ + if(DEFINED WITH_LLVM_CONFIG AND WITH_LLVM_CONFIG) + # search for preferred version + if(IS_ABSOLUTE "${WITH_LLVM_CONFIG}") diff --git a/pocl-doc.doc-base b/pocl-doc.doc-base new file mode 100644 index 0000000..d4c905b --- /dev/null +++ b/pocl-doc.doc-base @@ -0,0 +1,8 @@ +Document: pocl-doc +Title: Documentation for the pocl library +Author: The pocl developers +Section: Programming + +Format: HTML +Index: /usr/share/doc/pocl-doc/html/index.html +Files: /usr/share/doc/pocl-doc/html/*.html diff --git a/pocl-doc.docs b/pocl-doc.docs new file mode 100644 index 0000000..7a69846 --- /dev/null +++ b/pocl-doc.docs @@ -0,0 +1 @@ +build-doc/html diff --git a/pocl-opencl-icd.docs b/pocl-opencl-icd.docs new file mode 100644 index 0000000..724e084 --- /dev/null +++ b/pocl-opencl-icd.docs @@ -0,0 +1,2 @@ +README +TODO diff --git a/pocl-opencl-icd.install b/pocl-opencl-icd.install new file mode 100644 index 0000000..6549149 --- /dev/null +++ b/pocl-opencl-icd.install @@ -0,0 +1 @@ +etc/OpenCL/vendors/pocl.icd diff --git a/pocl-opencl-icd.lintian-overrides b/pocl-opencl-icd.lintian-overrides new file mode 100644 index 0000000..aca7cad --- /dev/null +++ b/pocl-opencl-icd.lintian-overrides @@ -0,0 +1,2 @@ +# This is kind of a metapackage. +package-contains-no-arch-dependent-files diff --git a/rules b/rules new file mode 100755 index 0000000..c57853e --- /dev/null +++ b/rules @@ -0,0 +1,127 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#DH_VERBOSE = 1 + +# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk +include /usr/share/dpkg/architecture.mk +include /usr/share/dpkg/pkg-info.mk + +# see FEATURE AREAS in dpkg-buildflags(1) +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic + +LLVM_VERSION = $(shell sed -n -r '/^Build/,/^$$/s/.*llvm-([0-9]+)-dev.*/\1/p' debian/control) + +LLVM_ARCH-amd64 = distro +#LLVM_ARCH-amd64 = x86-64 +#LLVM_ARCH-arm64 = generic +LLVM_ARCH-armel = arm946e-s # arch=armv5te +# armhf should rather be arch=armv7-a, e.g. cpu=cortex-a5 or similar with attr=+vfp3,+d16,+thumb2,-neon,-vfp4 +LLVM_ARCH-armhf = arm1156t2f-s +LLVM_ARCH-hurd-i386 = $(LLVM_ARCH-i386) +LLVM_ARCH-i386 = i686 # clang targets pentium4 by default +LLVM_ARCH-kfreebsd-amd64 = $(LLVM_ARCH-amd64) +LLVM_ARCH-kfreebsd-i386 = $(LLVM_ARCH-i386) +#LLVM_ARCH-mips = mips32r2 # guess +#LLVM_ARCH-mips64el = mips64r2 # guess +#LLVM_ARCH-mipsel = mips32r2 # guess +#LLVM_ARCH-powerpc = ppc +#LLVM_ARCH-ppc64 = ppc64 # guess +#LLVM_ARCH-ppc64el = ppc64le +#LLVM_ARCH-s390x = z10 +#LLVM_ARCH-sparc64 = v8 # guess +LLVM_ARCH-x32 = $(LLVM_ARCH-amd64) + +LLC_HOST_CPU = $(or $(patsubst pocl_cpu=%,%,$(filter pocl_cpu=%,$(DEB_BUILD_OPTIONS))),$(LLVM_ARCH-$(DEB_HOST_ARCH)),GENERIC) + +# NEON, optional for Debian, must not be used +EXTRA_HOST_CLANG_FLAGS-armhf = -mfpu=vfp3-d16 +# TODO: export KERNEL_LIB_OPT_FLAGS= -mattr=-neon,+d16,+vfp3,-vfp4,+v7,+aclass,+thumb2 + +# doc for symbols: +# http://www.eyrie.org/~eagle/journal/2012-01/008.html +# main packaging script based on dh7 syntax +%: + dh $@ --with pkgkde_symbolshelper --buildsystem=cmake + +getval = $(or $($1-$(DEB_HOST_ARCH)),$($1)) +var2flag = $(if $(strip $(call getval,$1)),-D$1="$(call getval,$1)") +POCL_CONFIGURE_FLAGS = +POCL_CONFIGURE_FLAGS += -DENABLE_ICD=yes +POCL_CONFIGURE_FLAGS += -DWITH_LLVM_CONFIG=/usr/bin/llvm-config-$(LLVM_VERSION) +POCL_CONFIGURE_FLAGS += $(if $(filter distro,$(LLC_HOST_CPU)),-DLLC_HOST_CPU=GENERIC -DKERNELLIB_HOST_CPU_VARIANTS=distro,-DLLC_HOST_CPU=$(LLC_HOST_CPU)) +POCL_CONFIGURE_FLAGS += $(call var2flag,EXTRA_HOST_CLANG_FLAGS) +POCL_CONFIGURE_FLAGS += -DPOCL_ICD_ABSOLUTE_PATH=OFF +POCL_CONFIGURE_FLAGS += -DHARDENING_ENABLE=ON +POCL_CONFIGURE_FLAGS += -DVISIBILITY_HIDDEN=ON +POCL_CONFIGURE_FLAGS += -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=OFF + +execute_before_dh_auto_configure: + test ! -d include/CL || mv -v include/CL include/_CL + test ! -d include/OpenCL || mv -v include/OpenCL include/_OpenCL + +execute_after_dh_auto_clean: + test ! -d include/_CL || mv -v include/_CL include/CL + test ! -d include/_OpenCL || mv -v include/_OpenCL include/OpenCL + +override_dh_auto_configure: + @echo Using LLC_HOST_CPU=$(LLC_HOST_CPU) + -/usr/lib/llvm-$(LLVM_VERSION)/bin/llc -version + -/usr/lib/llvm-$(LLVM_VERSION)/bin/llc -mattr=help + dh_auto_configure -- $(POCL_CONFIGURE_FLAGS) + +override_dh_auto_build-indep: +ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) + sphinx-build -N -b html doc/sphinx/source build-doc/html +else + mkdir -p build-doc/html +endif + +override_dh_shlibdeps: + dh_shlibdeps -l/usr/lib/$(DEB_HOST_MULTIARCH)/pocl -- --warnings=7 + +override_dh_auto_test-indep: +override_dh_auto_test-arch: + # Failure in testsuite is delayed until symbols handling + # and all files are logged. + $(RM) debian/stamp-failed-testsuite + $(RM) -r debian/kcache + mkdir debian/kcache + env POCL_CACHE_DIR=$(CURDIR)/debian/kcache \ + OCL_ICD_VENDORS=$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/ocl-vendors/pocl-tests.icd \ + POCL_BUILDING=1 POCL_DEVICES=basic clinfo || touch debian/stamp-failed-testsuite + env POCL_CACHE_DIR=$(CURDIR)/debian/kcache \ + OCL_ICD_VENDORS=$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/ocl-vendors/pocl-tests.icd \ + POCL_BUILDING=1 clinfo || touch debian/stamp-failed-testsuite + @set -ex; if ! env POCL_CACHE_DIR="$(CURDIR)/debian/kcache" dh_auto_test ; then \ + echo "***** The testsuite has failed! *****" ; \ + touch debian/stamp-failed-testsuite; \ + fi + $(RM) -r debian/kcache + +run_dh_makeshlibs: + dh_makeshlibs + +delayed_check_dh_auto_test_result: run_dh_makeshlibs + @set -ex; if test -f debian/stamp-failed-testsuite ; then \ + echo "***** The testsuite has failed! *****" ; \ + exit 1 ; \ + fi + @test -f obj-*/Testing/Temporary/LastTest.log && echo 'The testsuite has passed all tests.' || echo '*** The testsuite was *NOT* run! ***' + +override_dh_makeshlibs: run_dh_makeshlibs delayed_check_dh_auto_test_result + +override_dh_gencontrol: + dh_gencontrol -- \ + -V'LLVM:Version=$(LLVM_VERSION)' \ + + +fix-symbols: + pkgkde-getbuildlogs + echo "pkgkde-symbolshelper batchpatch -v $(DEB_VERSION_EPOCH_UPSTREAM) pocl_$(DEB_DISTRIBUTION)_logs/pocl_$(DEB_VERSION)_*build" diff --git a/source/format b/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/source/lintian-overrides b/source/lintian-overrides new file mode 100644 index 0000000..aa75a96 --- /dev/null +++ b/source/lintian-overrides @@ -0,0 +1,2 @@ +# the examples directory only contains CMakeFiles for external testsuites +package-does-not-install-examples examples/ diff --git a/upstream/metadata b/upstream/metadata new file mode 100644 index 0000000..dcb39aa --- /dev/null +++ b/upstream/metadata @@ -0,0 +1,4 @@ +Bug-Database: https://github.com/pocl/pocl/issues +Bug-Submit: https://github.com/pocl/pocl/issues/new +Repository: https://github.com/pocl/pocl.git +Repository-Browse: https://github.com/pocl/pocl diff --git a/watch b/watch new file mode 100644 index 0000000..07b60fc --- /dev/null +++ b/watch @@ -0,0 +1,4 @@ +version=4 +opts="uversionmangle=s/-RC(\d*)/~rc$1/, filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%@PACKAGE@-$1.tar.gz%" \ + https://github.com/pocl/pocl/releases \ + (?:.*?/)?v?(\d[\d.RC-]*)\.tar\.gz debian uupdate -- 2.30.2